I2P Address: [http://git.idk.i2p]

Skip to content

i2psnark: Fix leaked requests and partial pieces with data

zzz requested to merge zzz/i2p.i2p:snark-partials into master

causing stalls and slowdowns near the end of downloads. Side effects: leaked open temp piece files and file descriptors

Broken by changes in 2.5.0 allowing out-of-order chunk downloads, such that partial pieces with zero offset could still have data and open files. The previous logic for handing PartialPieces from PeerState to PeerCoordinator and selecting the next request did not correctly handle pieces with 'holes' in them. Another cause was the new request throttler allowing PeerState to have zero requests. Fixes for that include calling addRequest() at the end of chunk if there are no outstanding requests and handing the PartialPiece back if we are still throttled. Also tweak the logic to request PartialPieces from seeds more often to limit the backlog.

Merge request reports