mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-03-02 22:57:32 -05:00
Qbittorrent-nox rechecks/rehashes all torrents when restarted #2391
Labels
No labels
Accessibility
AppImage
Bounty
Build system
CI
Can't reproduce
Code cleanup
Confirmed bug
Confirmed bug
Core
Crash
Data loss
Discussion
Docker
Documentation
Duplicate
Feature
Feature request
Feature request
Feature request
Filters
Flatpak
GUI
Has workaround
I2P
Invalid
Libtorrent
Look and feel
Meta
NSIS
Network
Not an issue
OS: *BSD
OS: Linux
OS: Windows
OS: macOS
PPA
Performance
Project management
Proxy/VPN
Qt bugs
Qt6 compat
RSS
Search engine
Security
Temp folder
Themes
Translations
Triggers
Waiting diagnosis
Waiting info
Waiting upstream
Waiting web implementation
Watched folders
WebAPI
WebUI
autoCloseOldIssue
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/qBittorrent#2391
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @psbj on GitHub (Apr 21, 2015).
I'm using qbittorrent-nox with the webui on a headless installation of debian.
I used the build through apt-get previously (3.1.10) and today I tried out 3.2.0beta and the issue is still there. This was also an issue when I was running qbittorrent-nox on my raspberry pi (raspbian).
Whether it's stopped by a loss of power, intended shutdown, daemon stopping, or "exit qbittorrent" in the webui menu, all torrents are forced to recheck when it's started again.
This is a huge problem for people with a lot or very large torrents (or both).
@chrishirst commented on GitHub (Apr 22, 2015):
What version of libtorrent is it built against?
See #2750 (and #2853)
@psbj commented on GitHub (Apr 22, 2015):
Currently it's libtorrent 1.0.4, but previously it was libtorrent 0.16.18.
I tried compiling earlier versions of libtorrent but it says it's missing boost_system or something, even though it's not. 1.0.4 has non issues compiling.
@chrishirst commented on GitHub (Apr 22, 2015):
Okay I would suggest that this is starting to point to a libtorrent problem in v1.03 and above.
@psbj commented on GitHub (Apr 22, 2015):
I had this problem with libtorrent 0.16.18 as well.
@sledgehammer999 commented on GitHub (Apr 22, 2015):
Can you check the contents of "BT_backup" folder? When you close qbt, are .fastresume files created in there?
Can you alsos check the permissions of that folder and its contents?
You'll find this folder in
$HOME/.local/share/data/qBittorrent/@psbj commented on GitHub (Apr 22, 2015):
I just checked and there are .torrent and .fastresume files there. I started qbittorrent-nox and it resumed the torrents without problem.
This is weird, because I tested last night and it was rechecking all the torrents once I restarted the service.
Not sure what has changed but it appears to be working fine now. Strange.
@sledgehammer999 commented on GitHub (Apr 22, 2015):
Can you share the script that starts/restarts/stops the qbt service?
@psbj commented on GitHub (Apr 22, 2015):
It's the one in the wiki:
https://github.com/qbittorrent/qBittorrent/wiki/Running-qBittorrent-without-X-server#how-to-run-qbittorrent-nox-on-startup
@sledgehammer999 commented on GitHub (Apr 22, 2015):
Your problem may arise during system shutdown if you have many torrents in qbt.
Note: I am not very good with bash and linux scripting in general.
Look at the do_stop() function of the script you linked.
The above sends a SIGTERM signal to qbt which is ok. When qbt receives this, it starts shutting down by first trying to save the fastresume files. However this can take several seconds if you have many torrents. In fact even if you only 2-3 it may take at least 3 seconds to close.
So the
sleep 2may not be enough. Only 2 seconds.So during system shutdown, the service is supposedly stopped after ~2 when in fact qbt may still be running in the background. And since the script reported that the service is stopped, the OS shutdown continues and at some point it kills qbt.
The above is just a speculation. I may be totally wrong.
IMO, after the sleep there should a check of the running processes. If qbt is still running is should sleep again for 2 secs.
So putting the sleep in a while loop that checks for running qbt should suffice. (Don't expect any bash code from me though :P )
@psbj commented on GitHub (Apr 22, 2015):
Considering I have over 500 torrents I think it's safe to say that's the problem. Thanks for the help!
@sledgehammer999 commented on GitHub (Apr 22, 2015):
The man page for start-stop-daemon: http://manpages.ubuntu.com/manpages/lucid/en/man8/start-stop-daemon.8.html
You should add
--retry 120to the above command. It should recheck if qbt has finished before returning. And it should recheck continously for 2minutes. After 2 minutes it will error out.