Refuses to quit when Windows attempts to shut down #12016

Closed
opened 2026-02-21 22:13:53 -05:00 by deekerman · 12 comments
Owner

Originally created by @IRISHMAN04 on GitHub (Apr 11, 2021).

qBittorrent version and Operating System

qBittorrent v4.3.4.1 (64-bit)
Windows 10 Pro Update 20H2 10.0.19042

What is the problem

When I shutdown my computer, qBittorent stops it from shutting down with the message "Saving torrent progress". It stays on this window so long that Windows cancels the shutdown and locks itself.

What is the expected behavior

qBittorent quits and allows my computer to shut down.

Steps to reproduce

(I do not know if you need an actively seeding torrent or not for this to happen)

  1. Shut Down computer
  2. Go to bed
  3. Wake up the next day to see your computer at the lock screen, and after you unlock no applications open (including qBittorent which eventually closes)

Extra info(if any)

This issue has appeared before in the issue tracker, #7519, #5097, for example, and although marked as fixed it still happens.
Here is the log from the entire day when this issue occurred.
This happens approximately every other night.
qbittorrent.log.txt
I don't have Qt creator, but if someone wants to send me a test build I'll happily test it out.

Originally created by @IRISHMAN04 on GitHub (Apr 11, 2021). ### qBittorrent version and Operating System qBittorrent v4.3.4.1 (64-bit) Windows 10 Pro Update 20H2 10.0.19042 ### What is the problem When I shutdown my computer, qBittorent stops it from shutting down with the message "Saving torrent progress". It stays on this window so long that Windows cancels the shutdown and locks itself. ### What is the expected behavior qBittorent quits and allows my computer to shut down. ### Steps to reproduce (I do not know if you need an actively seeding torrent or not for this to happen) 1. Shut Down computer 2. Go to bed 3. Wake up the next day to see your computer at the lock screen, and after you unlock no applications open (including qBittorent which eventually closes) ### Extra info(if any) This issue has appeared before in the issue tracker, #7519, #5097, for example, and although marked as fixed it still happens. Here is the log from the entire day when this issue occurred. This happens approximately every other night. [qbittorrent.log.txt](https://github.com/qbittorrent/qBittorrent/files/6293319/qbittorrent.log.txt) I don't have Qt creator, but if someone wants to send me a test build I'll happily test it out.
Author
Owner

@FranciscoPombal commented on GitHub (Apr 26, 2021):

  • MANY UNNAMED TORRENTS RESTORED HERE *

How many? It may be causing qBittorrent to spend a lot of time saving resume data. In any case, it certainly should not take all night, and anyway, I was under the impression that if programs hadn't successfully closed after some time when shutting down Windows would kill them.

@FranciscoPombal commented on GitHub (Apr 26, 2021): > * MANY UNNAMED TORRENTS RESTORED HERE * How many? It may be causing qBittorrent to spend a lot of time saving resume data. In any case, it certainly should not take all night, and anyway, I was under the impression that if programs hadn't successfully closed after some time when shutting down Windows would kill them.
Author
Owner

@IRISHMAN04 commented on GitHub (Apr 30, 2021):

It was over 40, but they were all seeding so I assumed the progress wouldn't need to be saved. I'll remove them and see if that's a problem

@IRISHMAN04 commented on GitHub (Apr 30, 2021): It was over 40, but they were all seeding so I assumed the progress wouldn't need to be saved. I'll remove them and see if that's a problem
Author
Owner

@FranciscoPombal commented on GitHub (Apr 30, 2021):

It was over 40,

I assume this means between 40-50. This is definitely not too many, and certainly not enough to "be causing qBittorrent to spend a lot of time saving resume data." like I speculated above. Maybe something like anti-virus is interfering?

@FranciscoPombal commented on GitHub (Apr 30, 2021): > It was over 40, I assume this means between 40-50. This is definitely not too many, and certainly not enough to "be causing qBittorrent to spend a lot of time saving resume data." like I speculated above. Maybe something like anti-virus is interfering?
Author
Owner

@IRISHMAN04 commented on GitHub (May 7, 2021):

I took the number of torrents down to 11 and it still did it, even with my antivirus off.

@IRISHMAN04 commented on GitHub (May 7, 2021): I took the number of torrents down to 11 and it still did it, even with my antivirus off.
Author
Owner

@NateScarlet commented on GitHub (Dec 19, 2021):

I have also had this issue for a few months, and just found a way to ensure that it can be shut down without user interaction.

run this command:

REG ADD "HKCU\Control Panel\Desktop" /f /v AutoEndTasks /d 1
@NateScarlet commented on GitHub (Dec 19, 2021): I have also had this issue for a few months, and just found a way to ensure that it can be shut down without user interaction. run this command: ```shell REG ADD "HKCU\Control Panel\Desktop" /f /v AutoEndTasks /d 1 ```
Author
Owner

@IRISHMAN04 commented on GitHub (Dec 19, 2021):

I'll have a look at that when I get home, thanks

@IRISHMAN04 commented on GitHub (Dec 19, 2021): I'll have a look at that when I get home, thanks
Author
Owner

@RedSnt commented on GitHub (May 26, 2022):

The fix, for me anyway, is a bit of a boring one. Disabling my network connection while shutting qbittorrent down makes it shut down instantly, so that's what I do. Huge bother to do so in Windows 10 of course when done manually, but I'm sure it can be automated using a script.

Anyway, seems to me that the problem is qbittorrent lingering, waiting for some network related job to finish, or otherwise I don't know why disabling the network makes it shut down instantly.

@RedSnt commented on GitHub (May 26, 2022): The fix, for me anyway, is a bit of a boring one. Disabling my network connection while shutting qbittorrent down makes it shut down instantly, so that's what I do. Huge bother to do so in Windows 10 of course when done manually, but I'm sure it can be automated using a script. Anyway, seems to me that the problem is qbittorrent lingering, waiting for some network related job to finish, or otherwise I don't know why disabling the network makes it shut down instantly.
Author
Owner

@RedSnt commented on GitHub (May 26, 2022):

A fix that seems to work for me, which is perhaps a bit convoluted is creating a batch script that runs on windows shutdown.

step 1)

Create a script like this:

@echo off
echo.
echo Shutting down network service..
echo.
netsh interface set interface "Ethernet" DISABLE
echo.
echo Killing qBittorrent tasks TWICE to close both visible window and tray icon..
echo.
taskkill /FI "WINDOWTITLE eq qBittorrent*" /T
taskkill /FI "WINDOWTITLE eq qBittorrent*" /T
echo.
echo Waiting ~1 second for qBittorrent to lose connection..
echo.
timeout 1
echo.
echo Re-enabling network service..
echo.
netsh interface set interface "Ethernet" ENABLE
echo.
echo Shutting down console!
echo.
exit 0

Note: Worth doing a "netsh interface show interface" in a command prompt to get the interface name which might be different for your computer, and change that in the script.

Save it as "close_qbittorrent.bat" or something.

step 2)

Open GPEDIT.MSC (group policy editor) and add the script to:
Computer Configuration -> Windows Settings -> Scripts (Startup/Shutdown) -> Shutdown
Pretty self explanatory how to add the script once you're there.

I dunno, maybe overkill or a dumb solution, but it works for me.

@RedSnt commented on GitHub (May 26, 2022): A fix that seems to work for me, which is perhaps a bit convoluted is creating a batch script that runs on windows shutdown. step 1) Create a script like this: ``` @echo off echo. echo Shutting down network service.. echo. netsh interface set interface "Ethernet" DISABLE echo. echo Killing qBittorrent tasks TWICE to close both visible window and tray icon.. echo. taskkill /FI "WINDOWTITLE eq qBittorrent*" /T taskkill /FI "WINDOWTITLE eq qBittorrent*" /T echo. echo Waiting ~1 second for qBittorrent to lose connection.. echo. timeout 1 echo. echo Re-enabling network service.. echo. netsh interface set interface "Ethernet" ENABLE echo. echo Shutting down console! echo. exit 0 ``` Note: Worth doing a "netsh interface show interface" in a command prompt to get the interface name which might be different for your computer, and change that in the script. Save it as "close_qbittorrent.bat" or something. step 2) Open GPEDIT.MSC (group policy editor) and add the script to: Computer Configuration -> Windows Settings -> Scripts (Startup/Shutdown) -> Shutdown Pretty self explanatory how to add the script once you're there. - I dunno, maybe overkill or a dumb solution, but it works for me.
Author
Owner

@palur76 commented on GitHub (Oct 7, 2022):

I have the same problem with qBittorent v4.4.5 (64-bit) on Windows 10.0.19044.2075.

qBittorrent breaks Windows 10 shutdown process, because "Saving torrent progress".

@palur76 commented on GitHub (Oct 7, 2022): I have the same problem with qBittorent v4.4.5 (64-bit) on Windows 10.0.19044.2075. qBittorrent breaks Windows 10 shutdown process, because "Saving torrent progress".
Author
Owner

@ItsIgnacioPortal commented on GitHub (Feb 11, 2023):

REG ADD "HKCU\Control Panel\Desktop" /f /v AutoEndTasks /d 1

That registry key will automatically force-close the app if it doesn't close itself after the default timer is done (20 seconds). I think it's better to increase the shutdown waiting-time and let qbittorrent shutdown gracefully:

REG ADD "HKCU\Control Panel\Desktop" /f /v WaitToKillAppTimeout /d "50000"

undo:

REG ADD "HKCU\Control Panel\Desktop" /f /v WaitToKillAppTimeout /d "20000"
@ItsIgnacioPortal commented on GitHub (Feb 11, 2023): > ```shell > REG ADD "HKCU\Control Panel\Desktop" /f /v AutoEndTasks /d 1 > ``` That registry key will automatically force-close the app if it doesn't close itself after the default timer is done (20 seconds). I think it's better to increase the shutdown waiting-time and let qbittorrent shutdown gracefully: ``` REG ADD "HKCU\Control Panel\Desktop" /f /v WaitToKillAppTimeout /d "50000" ``` undo: ``` REG ADD "HKCU\Control Panel\Desktop" /f /v WaitToKillAppTimeout /d "20000" ```
Author
Owner

@xavier2k6 commented on GitHub (Sep 30, 2024):

qBittorrent v4.3.4.1 (64-bit)

Version is obsolete.

Thank you for your contribution, we are starting to close all old/stale/obsolete tickets.

Please update to latest qBittorrent 5.0.0 ATTOW.

If any issues are experienced, please open a new ticket.

@xavier2k6 commented on GitHub (Sep 30, 2024): >qBittorrent v4.3.4.1 (64-bit) Version is obsolete. Thank you for your contribution, we are starting to close all old/stale/obsolete tickets. Please update to latest qBittorrent 5.0.0 ATTOW. If any issues are experienced, please open a new ticket.
Author
Owner

@RedSnt commented on GitHub (Sep 30, 2024):

Doesn't matter anymore indeed. Switched to linux and turns out the QT6 build closes correctly, it was QT5 that was the problem all along.

@RedSnt commented on GitHub (Sep 30, 2024): Doesn't matter anymore indeed. Switched to linux and turns out the QT6 build closes correctly, it was QT5 that was the problem all along.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/qBittorrent#12016
No description provided.