Repository navigation
fix(cli,client): put the entry floor on the multi-source path - #2141
Merged
Merged
Conversation
The drive-level throughput floor covered single-source and range-dedup drives only. The multi-source scheduler's unit watchdog judges one lane's unit at a time, so a fetch whose lanes all crawl inside their deadlines never tripped anything. - `multi_source_fetch_until` and `Downloader::fetch_to_paths_until` take a `stop` that races only the workers, so the final present-record flush still runs and finalize is never timed. - `multi_source_download` runs under `drive_floor` with an `EntryWatch` across every lane and a `PausingFunder`. A trip is `EntryStalled`, which falls back to single-source failover on the resumed `.partial`. - `EntryWatch::observing` builds the observe-then-forward callback both drives install. - The scheduler and Downloader progress callbacks take a borrowed trait object. Refs #2123 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Two critical missing Future imports prevent the client crate from compiling.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 2
Open (2)
What changed in this PR
Extends the throughput floor to multi-source downloads while preserving partial progress for failover and resume.
Changes:
- Adds stop-aware scheduler and downloader APIs.
- Applies entry-wide monitoring across multi-source lanes.
- Updates tests, API snapshots, changelog, and ADRs.
| File | Summary |
|---|---|
crates/client/tests/snapshots/public_api__public_api.snap |
Updates public API snapshots. |
crates/client/src/scheduler.rs |
Adds stoppable multi-source fetching. |
crates/client/src/lib.rs |
Re-exports the new API. |
crates/client/src/downloader.rs |
Adds stoppable download orchestration. |
crates/cli/src/commands/fetch.rs |
Applies entry-level throughput monitoring. |
CHANGELOG.md |
Documents the fix. |
adr/appendix-bundles.md |
Documents multi-source throughput behavior. |
adr/039-multi-source-parallel-fetch.md |
Records the throughput-floor design. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Code Coverage OverviewLanguages: Rust Rust / code-coverage/cargo-llvm-covThe overall line coverage in commit 797421d in the Show a line coverage summary of the most impacted files.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Refs #2123 (bullet: entry floor on the multi-source path)
The drive-level throughput floor from #2120 (
--min-throughput-bpsover--stall-timeout-ms, measured across every leg) covered single-source and range-dedup drives only. The multi-source scheduler's--unit-deadline-mswatchdog judges one lane's unit at a time. A fetch where every lane crawled just inside its deadline therefore never tripped anything, and-vshowed no rate/ETA line.Changes
decdn-clientmulti_source_fetch_untilandDownloader::fetch_to_paths_untiltake astopfuture. The existing entry points delegate withpending().stophas the same contract asdrive_range_set's: it races only the workers insidedrive_with_interval_flush. A pending record write lands, the final flush runs, andfinalizeis never timed.+ '_), asdrive_range_set's already do. The public-api snapshot is regenerated.multi_source_downloadruns underdrive_floor, with oneEntryWatchacross all lanes and the funder wrapped inPausingFunder.EntryStalled(RetryElsewhere).fetch_over/fetch_to_stagingalready fall back to single-source failover on a retryable multi-source error and resume the.partial. Every lane's watermark is still persisted before the result is examined.EntryWatch::observingbuilds the observe-then-forward callback for both drives. It is always installed, because the scheduler reports no progress without a callback (bars off).appendix-bundles§ Failover and retry, CHANGELOG.Tests
scheduler::a_stop_ends_the_fetch_and_keeps_the_landed_bytes_recorded: two crawling lanes with the unit watchdog off. The stop error comes back unwrapped, and both lanes' landed checkpoints are recorded.downloader::a_stop_leaves_the_partial_for_a_resume: the target is not promoted, and the landed prefix is recorded.fetch::observing_feeds_the_watch_with_or_without_a_ui_callback.Local verification
cargo fmt --check, workspace clippy-D warnings --all-targets --all-features, and rustdoc-D warningsall pass.nextest -p decdn-client -p decdn-cli -p decdn-common --all-features: 1653 pass, including public_api.cli_fetch_multi_source,cli_bundle_pull_multi_source,cli_fetch_resume,cli_bundle_pull_range_dedup): 10 pass.🤖 Generated with Claude Code