libtorrent version (or branch):
RC 1.1 8808eb7
platform/architecture:
Windows 1803 x64 (qBittorrent 4.1.0)
Some trackers are not properly reported the uploaded quantity because they are not take the first announce after the download completed. We tracked down the root cause of this issue. The downloaded bytes in the 1st announce (when the download completed) is more than in the next announce.
related qbittorrent issue: https://github.com/qbittorrent/qBittorrent/issues/8849
example:
event=completed announce: downloaded bytes= 5228289362

next announce: downloaded bytes= 5228224536 (this is the real file size)

Based on the downloaded and redundant counts, it appears that at the time of the completed announce there were 64825 bytes which had been accounted for as downloaded but not as redundant. I'm still trying to figure out how that could have happened. It appears that in the normal case the downloaded and redundant counts get updated together such that no announce could happen in-between.
Ah, it must have been multiple peers with partially downloaded blocks at the time of completion. The easiest way I can see to fix this is to not update the downloaded stat until either the entire block is received or the peer is disconnected.
Would libtorrent logs from a session be helpful in diagnosing/fixing this?
No need, I'm pretty sure I know what's going on here. I just need to figure out the best way to fix it.
The "simple" solution of deferring updating the downloaded stat until a complete block is downloaded turned out to be impractical for web seeds. I've put in a PR with Plan B which is to adjust the downloaded parameter to account for partially downloaded blocks.
Test build is available in #3025
So is this related to previous issues? Like https://github.com/qbittorrent/qBittorrent/issues/8108 and https://github.com/arvidn/libtorrent/issues/2724
So is this related to previous issues? Like qbittorrent/qBittorrent#8108 and #2724
IMO, it is the same bug.
steven's patch has been merged to RC_1_1
Most helpful comment
No need, I'm pretty sure I know what's going on here. I just need to figure out the best way to fix it.