Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Overall progress for paused torrents is sometimes mis-reported - recheck fixes it #12227
Please provide the following information
qBittorrent version and Operating System
Latest master, Ubuntu 18.04
If on linux, libtorrent-rasterbar and Qt version
libtorrent 1.2.5, Qt 5.9.5
What is the problem
Overall progress is sometimes misreported (i.e. inconsistent with file progress) for paused torrents. This is probably some kind of race-condition.
I have observed this with fast torrents (e.g. Ubuntu ISO torrents), in which case the overall progress should be the same as the file progress. A force recheck will fix the problem. When it differs, the overall progress is always greater than file progress. I have not seen any instance where it was less.
What is the expected behavior
Overall progress should always be accurate.
Steps to reproduce
Extra info(if any)
This probably also happens in multi-file torrents, but it's harder to see if the overall progress percentage is correct or not.
This label assignment can always be challenged. IMO it's reasonable to have bugs reported by a team member automatically become "Confirmed bugs" and remain so until proven otherwise, and not the other way around.
If you need more information for reproducing this let me know. I imagine for this one it will be tricky, as reproducing, diagnosing and fixing race condition-type bugs is always a pain.
This corroborates my observation that file progress is always the smaller value and never regresses. I also think the expected user experience is to not make progress regress.
Then I took a look at other places in the code and found that, for example, folder progress in the "Content" tab is derived from summing all file progress under it. This makes sense.
But then I saw the code for the global progress:
It is not based on file progress, hence the disparity. In addition, the logic is not entirely clear to me, why does it not always return
And this leads to even more questions:
If the answer to 2 is "yes", then we should consider calculating total progress from file progress as well. It is probably even "free" since we are already iterating through all file progress elsewhere to populate the content tab. But in this case I'd think it would make more sense for total progress reported by libtorrent to be consistent with file progress, independently of the value of