Commit Graph

3361 Commits

Author SHA1 Message Date
Matt Joiner 32097526fc Add bencode.Decoder.MaxStrLen 2022-01-07 19:11:41 +11:00
Matt Joiner e8bd16257c fs/test.sh: Use go run instead of godo 2021-12-28 12:06:29 +11:00
Matt Joiner 50fcd908ca tracker/udp.ConnClient: Make logging configurable
Should fix https://github.com/anacrolix/torrent/issues/701#issue-1088130173
2021-12-28 12:05:01 +11:00
Matt Joiner 2e9ecd5a32 Reject peer requests on data read failures 2021-12-27 22:19:04 +11:00
Matt Joiner f7494791d0 Reduce some logging 2021-12-27 22:06:52 +11:00
Matt Joiner 14d636ec50 Fix TestTorrentDroppedDuringResponsiveRead flakiness 2021-12-27 21:16:51 +11:00
Matt Joiner fc857d4557 Allow stealing from slower connections within priority classes 2021-12-24 08:56:10 +11:00
Matt Joiner 1bae62fd22 Dynamic outbound max requests
This might be one solution to https://github.com/anacrolix/torrent/issues/698.
2021-12-24 08:55:57 +11:00
Matt Joiner 89b8b78980 Include requests pending cancel in current request count
This fix a situation where peers might be dropping our requests, and since we depend on all requests being satisfied before re-requesting, we get stuck waiting for the request to be filled.
2021-12-23 18:55:57 +11:00
Matt Joiner 9d07f3ea77 Replace piece availability with frequencies in Torrent status 2021-12-23 17:01:39 +11:00
Matt Joiner dbbe2fa71e Revert go directive to 1.16 2021-12-23 14:00:01 +11:00
Matt Joiner 9f2e2e39fa cmd/torrent: Add --linear-discard 2021-12-23 14:00:01 +11:00
Matt Joiner 9739afce93 Fix panic in webseeds updating requests when Torrent is closed
I think this was caused by PieceRequestOrder being removed if all pieces in a storage capacity key are deleted.
2021-12-23 14:00:01 +11:00
Matt Joiner 7772d50f74 cmd/torrent: Lower burst when there's a download rate limit 2021-12-23 14:00:01 +11:00
Matt Joiner cc0d223a65 Apply download rate limiter to webseeds 2021-12-23 14:00:00 +11:00
Matt Joiner 87dfef7778 Don't wait for DHT pings
Fixes a growing backlog of pings if DHT servers are rate-limited in their queries.
2021-12-23 14:00:00 +11:00
Matt Joiner 80aec73cb5 Make Torrent.cancelRequestsForPiece more efficient 2021-12-23 14:00:00 +11:00
Matt Joiner 506ff8d037 Use relative availabilities to determine piece request order
Most overhead comes from peers that connect that have everything, and we just increment every single piece's availability. There may be some unresolved determinism with torrents that share the same ordering.
2021-12-23 14:00:00 +11:00
Matt Joiner bdb33ef9f7 gofumpt -extra 2021-12-23 14:00:00 +11:00
Matt Joiner 74c70d852a Add TestHaveAllThenBitfield
The result of a misguided attempt to reduce piece peer availability increment and decrement overhead for have all/full-bitfield and conn closes.
2021-12-23 14:00:00 +11:00
Preston b831060d6e
fix http tracker arg position (#700)
Co-authored-by: Bot Git <bot@example.com>
2021-12-23 12:34:16 +11:00
martin b6cc93c0be * set proxy of websocket tracker to the proxy used by client config 2021-12-16 16:04:59 +11:00
Matt Joiner 73bdd5a7a4 Fix leaked mmap storage in test 2021-12-16 14:19:21 +11:00
Matt Joiner 12c77bc410 Fix race in TextPexConnState 2021-12-16 14:19:21 +11:00
Matt Joiner 48fa9b59fd Fix go-libutp import when CGO is disabled 2021-12-16 14:19:21 +11:00
Matt Joiner 2b0ec5d762 Test benchmarks in a separate step and limit executions 2021-12-16 14:19:19 +11:00
Matt Joiner ffb98097fa Fix BenchmarkUpdatePiecePriorities 2021-12-16 14:00:19 +11:00
Matt Joiner e7ee568c52 Fix BenchmarkConnectionMainReadLoop
Broken by piece request order changes.
2021-12-16 14:00:19 +11:00
Matt Joiner 1668a18859 Some optimizations in PieceRequestOrder.Update and item comparisons 2021-12-15 19:18:16 +11:00
Matt Joiner 8c129d6bfc Retract v1.39.0 2021-12-13 12:16:43 +11:00
Matt Joiner c0a888ee17 Tidy up request heaping comments 2021-12-13 12:12:30 +11:00
Matt Joiner 9d9556c97f Add Peer.cancelAllRequests for webseedPeer 2021-12-13 12:11:38 +11:00
Matt Joiner 98f188dcbe Update requests after deleting all in some corner cases
Choked by non-fast PeerConn, deleted PeerConn. They're not exactly guarded as strictly as they could be, so there's plenty of room for performance improvements here.
2021-12-13 12:09:12 +11:00
Matt Joiner 47ef8d9c2d Assert that a request isn't cancelled before requesting it again 2021-12-13 11:56:57 +11:00
Matt Joiner a671c06b94 Update peer requests if not interested when piece priorities change
This should fix a starvation issue where we don't signal interest to a peer that has us choked.
2021-12-13 11:55:47 +11:00
Matt Joiner 26b521b41c Explicitly use go-libutp synchronous firewall callback 2021-12-12 21:32:29 +11:00
Matt Joiner 3d3052b8bd Merge branch 'request-strategy-experiments'
This should bring in significant performance improvements that fix issues with the peer-requesting that existed from v1.34.0.
2021-12-12 18:38:33 +11:00
Matt Joiner 04beb8937f More consistent cancellation management 2021-12-12 18:35:02 +11:00
Matt Joiner 30375615b3 Remove unused request strategy code 2021-12-12 18:35:02 +11:00
Matt Joiner 1bc84e316f Don't group Torrent piece request orders without a storage capacity together 2021-12-12 18:35:02 +11:00
Matt Joiner 8c5df03e14 Minimize allocations due to heap escapes 2021-12-12 18:35:01 +11:00
Matt Joiner 8c9a308c9a Only steal an odd request if the stealer more recently received a chunk
This helps break the stealing cycle during endgame, and lets us trickle the request to the peer conn with the best record. It might not be sufficient but works nice in testing so far.
2021-12-12 18:35:01 +11:00
Matt Joiner 7de7b986c9 Only use last requested when both requests are already pending 2021-12-12 18:35:01 +11:00
Matt Joiner ddf41fc2f1 Add Torrent-level request cancel for consistency 2021-12-12 18:35:01 +11:00
Matt Joiner aca22a0896 Update peer cancel assumptions and return 2021-12-12 18:35:01 +11:00
Matt Joiner 1b92249f2a Improve panic message 2021-12-12 18:35:01 +11:00
Matt Joiner 117ae28b38 Try request stealing 2021-12-12 18:35:01 +11:00
Matt Joiner 73be571f50 Don't try to request anything without the torrent info 2021-12-12 18:35:01 +11:00
Matt Joiner 99a64bcf63 Wait between duplicate requests 2021-12-12 18:35:01 +11:00
Matt Joiner 8025d15155 Stop iterating pieces when storage is exhausted 2021-12-12 18:35:01 +11:00