anacrolix / torrent

Full-featured BitTorrent client package and utilities
Mozilla Public License 2.0
5.51k stars 622 forks source link

Small torrents with sparse seeding not completing #934

Open mh0lt opened 5 months ago

mh0lt commented 5 months ago

On testing the latest releases of Erigon over the past few months we've noticed that it's download phase, which downloads historic blockchain state across bittorrent stops at 99.999% complete.

We've discovered this is becuase a number 1-6 small torrents which have data on webseeds but not many torrent peers stop indefinately and hence prevent the completion of the torrent download.

We're building with v1.54.1 and go 1.20.

On investigation I've discovered that the torrents that don't download are ignoring their webseeds on initial download and becuase the webseeds never retry getting requests they will remain failed forever.

I have added a PR https://github.com/anacrolix/torrent/pull/932 to the mater branch which fixes this.

I have tested with a local patch of v1.54.1 and this seems to fix the issue.

I've noticed that the current master is building with go 1.22 and also has changes for V2 bittorrent which mean an interface change.

Ideally it would be great for us if this change could be merged to 1.54 or 1.55 so we can have a non breaking fix.

anacrolix commented 5 months ago

I thought there was a fix for something related to webseeding on master. Have you had a chance to try master for this problem?

anacrolix commented 5 months ago

See 528c5f69d657d6edb7359674473eec1ccff10b9a. Is it related at all?

anacrolix commented 5 months ago

I think it wasn't. I've commented on the PR for clarification.

anacrolix commented 3 months ago

I just closed 2 related PRs (noting that I cherry picked a bunch of stuff). From reading here it would seem maybe I didn't include the specific fixes you wanted however. Is that the case?