qBittorrent icon indicating copy to clipboard operation
qBittorrent copied to clipboard

qBittorrent will not terminate gracefully

Open kwhat opened this issue 2 years ago • 5 comments

qBittorrent & operating system versions

qBittorrent: 4.4.5 x64 Operating system: Gentoo Linux 17.1 Qt: 5.15.5 libtorrent-rasterbar: 2.0.7

What is the problem?

qBittorrent will not exit when selecting quit from the menu or try icon. It seems to hang where it continues to run but the interface is no longer available. Sending a term signal has no effect and only kill will terminate the program.

Steps to reproduce

  1. start qBittorrent
  2. download something
  3. seed for a few minutes
  4. try to exit

Additional context

This is something to started to happen recently after and upgrade. I've been using the software and current settings for a years without issue.

Log(s) & preferences file(s)

No response

kwhat avatar Sep 14 '22 14:09 kwhat

It's not issue, qbittorrent just saves resume data on exit. You may see disk activity while this happening.

Aleksman4o avatar Sep 14 '22 18:09 Aleksman4o

Got this problem a few times too on Windows but because I was having lot of problems with qBt I didn't report it as I thought it may be caused by those other issues.

At the time I checked, from StackOverflow, they said a process can be unkillable because it has pending I/O. I don't know if it's something on qBt side, Windows side or network driver side.

So just if it may help you or someone else understand, here is what happened the last time the issue occured. I exited my struggling (due to my other issues) 4.4.5 and I waited for hours for the process to die because killing it did nothing. Memory usage was going down but super slowly like 4k per 10 seconds but, finally, I had to restart my computer. At the end, it was using just a few megabytes of memory and there was only 1 thread left stuck on a closing socket call.

image

tristanleboss avatar Sep 16 '22 06:09 tristanleboss

Can confirm this is also happening on Windows 10 with latest patches. It does terminate eventually, but it takes several minutes. This is particularly bad when trying to restart the PC.

BenMcLean avatar Sep 16 '22 17:09 BenMcLean

How log it takes seems to vary depending on whats happening. I just quit after letting it run all night and it didn't shut down instantly but it did terminate in about 60 seconds. Sometimes it takes quite a bit longer causing me to send a sig-kill. Next time I download some sizable data I will keep an eye on the I/O and see if it is indeed writing stuff out to disk.

kwhat avatar Sep 17 '22 17:09 kwhat

For me it is terminating gracefully on Windows 7 with qBittorrent 4.4.5. But it takes around 20min to so. During that time there is no disk activity and only a bit of network activity.

Dobatymo avatar Sep 20 '22 11:09 Dobatymo

I am having the same problem qBittorrent: 4.4.5 x64 Operating system: windows 11

fromiron avatar Sep 25 '22 12:09 fromiron

Same problem on the Mac using version 4.4.5

ballo avatar Sep 26 '22 23:09 ballo

@arvidn Are there any significant differences between libtorrent-1.2 and libtorrent-2.0 that affect the termination of the session? Maybe libtorrent-2.0 contains some kind of fix that was not backported in libtorrent-1.2?

glassez avatar Sep 27 '22 10:09 glassez

@glassez from the original report it seems to affect libtorrent 2.0.7, suggesting it might be the other way around. some issue introduced in 2.0.x

generally these kinds of issues can be debugged with the asio-debugging=on build option, which will print to stdout which operations are still active when shutting down. It might not be suitable for a GUI application without a terminal attached though.

arvidn avatar Sep 27 '22 10:09 arvidn

@glassez from the original report it seems to affect libtorrent 2.0.7, suggesting it might be the other way around.

Oops... This problem "reappeared" with the release of version 4.4.5, in which we re-began to use libtorrent 1.2 by default, so I mistakenly thought that it was related with it (in my haste, I did not notice the mention of the libtorrent version in the original description, and subsequent commenters were too lazy to mention it at all). We need to collect more statistics...

So what about the rest of the commenters? What kind of build are you using? Is it based on libtorrent-2.0 or on libtorrent-1.2?

glassez avatar Sep 27 '22 12:09 glassez

4.5.0-alpha1 libtorrent 1.2.7

tristanleboss avatar Sep 27 '22 17:09 tristanleboss

@glassez from the original report it seems to affect libtorrent 2.0.7, suggesting it might be the other way around.

Oops... This problem "reappeared" with the release of version 4.4.5, in which we re-began to use libtorrent 1.2 by default, so I mistakenly thought that it was related with it (in my haste, I did not notice the mention of the libtorrent version in the original description, and subsequent commenters were too lazy to mention it at all). We need to collect more statistics...

So what about the rest of the commenters? What kind of build are you using? Is it based on libtorrent-2.0 or on libtorrent-1.2?

windows 11 Pro 21H2(22000.978) qbittorrent 4.4.5 libtorrent 1.2.17.0

fromiron avatar Sep 28 '22 03:09 fromiron

Same issue on Linux Ubuntu Mate 22.04 running the command PKILL. The GUI quit, but the process and the tray's icon still running some seconds later. pkill qbittorrent

https://user-images.githubusercontent.com/24923693/194691175-ead480ab-7395-4912-a8fc-d0be50196404.mp4

Philippe734 avatar Oct 08 '22 05:10 Philippe734