Skip to content

download: never abandon the last progressing peer on min_speed - #12

Merged
mindrunner merged 1 commit into
cm-fetch-exit-nonzero-when-behindfrom
cm-min-speed-keeps-last-peer
Nov 5, 2026
Merged

mindrunner merged 1 commit into
cm-fetch-exit-nonzero-when-behindfrom
cm-min-speed-keeps-last-peer

Conversation

@mindrunner

@mindrunner mindrunner commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

On wt-2 every peer delivered 70 to 120 MB/s against a 250 MB/s floor (238.4 MiB/s). Every plan was aborted after 60s, so nothing ever landed. richat-sao-rpc-0 hit the same floor at 75 MiB/s (rpc-infrastructure #1048).

  • After a peer trips the floor, its remaining plans are skipped for the rest of the cycle.
  • The floor applies only while a plan from another usable peer remains (policy::plan_attempt, pure and unit tested). The last candidate runs unenforced, so a slow but progressing download is never abandoned.
  • A transfer that moves no bytes for 60s always aborts, even with min_speed = 0. Chunk reads now poll the abort flag every second, so a stalled connection is actually dropped. Before, the flag was only checked when a chunk arrived.
  • The watchdog abort is a typed SlowTransfer error. aria2c exit code 5 (too slow) maps to it too.

Docs: README, CONTEXT.md, examples/config.toml.

Tests: three plan_attempt unit tests and a stalled-stream abort test. fmt, clippy and test pass locally.

mindrunner commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner Author

@mindrunner
mindrunner marked this pull request as ready for review November 5, 2026 10:33
@mindrunner
mindrunner merged commit a94a8a8 into cm-fetch-exit-nonzero-when-behind Nov 5, 2026
5 checks passed
@mindrunner
mindrunner deleted the cm-min-speed-keeps-last-peer branch November 19, 2026 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant