Repository navigation
fix(client,node): steal a slow leg's tail by pull-through and time serve waits (#2348) - #2357
Merged
Merged
Conversation
…rve waits (#2348) A lane could steal only inside a range's covered suffix, so a range whose last block only one lane covered ran on that lane to the end, however slow: in #2348 one 0.5 MiB/s lon1 leg ran alone for 35 min while every other lane sat idle. Client: when no covered-suffix steal qualifies, a lane not barred from pull-through steals the rate-weighted tail of another lane's range that runs at a quarter of its rate or less (SLOW_VICTIM_FACTOR), measured over at least 30 s of active time (SLOW_VICTIM_EVIDENCE, parks on the consumer left out, the open one included). Its node serves the part outside its coverage by pull-through. A parked own worker re-checks every 5 s (STEAL_RECHECK) and takes no stream permit unless a steal is due. A refused steal requeues the tail and the usual pull-through bars apply. Node: serve_stream spans record store_wait_ns / send_wait_ns / proof_wait_ns, the selected path's kind, RTT, cwnd and congestion events, and connection loss/sent deltas over the serve loop, on every exit of the hit and miss serve loops. Telemetry for #2348 points at the lon1 -> client path, not lon1's store; these fields let the next run say which. ADR 039 gains the slow-victim rule and its three parameters; the observability appendix documents the new span fields. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Rate sampling has an atomic snapshot race, and hit-path exits can omit the promised telemetry fields.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Adds slow-leg tail stealing to reduce fetch latency and expands node serve diagnostics.
Changes:
- Adds rate-based pull-through tail stealing and periodic parked-worker checks.
- Records serve-loop wait and QUIC path telemetry.
- Updates tests, ADRs, and changelog documentation.
| File | Description |
|---|---|
crates/client/src/scheduler.rs |
Implements slow-victim stealing and rate accounting. |
crates/client/src/source_set.rs |
Updates uncovered-range semantics. |
crates/node/src/handlers/client/serve_waits.rs |
Adds serve wait and path telemetry. |
crates/node/src/handlers/client/delivery.rs |
Instruments cache-hit serving. |
crates/node/src/handlers/client/serve_leg.rs |
Instruments pull-through serving. |
crates/node/src/handlers/client/proof_wait.rs |
Exposes selected-path details. |
crates/node/src/handlers/client/dispatch.rs |
Declares new span fields. |
crates/node/src/handlers/client/mod.rs |
Registers the telemetry module. |
crates/node/tests/support/mod.rs |
Adds telemetry assertions. |
crates/node/tests/client_loopback.rs |
Verifies hit-path telemetry. |
crates/node/tests/node_origin_pull.rs |
Verifies miss-path telemetry. |
adr/039-multi-source-parallel-fetch.md |
Specifies slow-victim scheduling. |
adr/appendix-observability.md |
Documents telemetry fields. |
CHANGELOG.md |
Records the behavior and observability changes. |
💡 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 1a0fe8a in the Show a line coverage summary of the most impacted files.
Updated |
…e setup waits (#2348) Unit::rate_sample read `parked` then `park_open_at`, the same order ClosePark writes them, so a park that closed between the two loads was subtracted from neither and a victim could read as slow. Read the open marker first with Acquire against ClosePark's Release clear: a closing park is now left out once or twice, never not at all. ServeWaits started after the hit loop's export and pool-funder awaits (and the miss loop's pool-funder await), so an exit or cancel there recorded no wait fields. Start the guard at each loop's first await, and time the export's setup as store wait. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

Summary
Refs #2348.
MIN_SPLIT_SIZE,MIN_STOLEN,MIN_VICTIM_KEEP, victim keeps a missing byte) apply.serve_streamwait breakdown. New fields:store_wait_ns,send_wait_ns,proof_wait_ns,path_kind,path_rtt_us,path_cwnd,path_congestion_events,conn_lost_packets,conn_lost_bytes,conn_sent_bytes. They are recorded on every exit of the hit (deliver_loop) and miss (serve_leg_loop) loops, cancel included. Telemetry for bundle pull: a 1.15 GiB leg on a 0.5 MiB/s lon1 lane runs alone for 35 min while every other lane is idle (SDXL, 2 of 2 runs) #2348 shows lon1 served other nodes at 30–60 MB/s per stream with an idle disk, while every lon1→client stream ran at ~1.3 MB/s aggregate (bcl→client was slow too). That is the path or client side, not lon1's store. These fields let the next run say which.slow_victim_factor/slow_victim_evidence/steal_recheck.appendix-observabilitydocuments the new fields. CHANGELOG has Fixed and Added entries.The node half of #2348 (why the lon1→client path is slow) stays open until a testnet run with these fields.
Test plan
cargo nextest run -p decdn-client -p decdn-node: 2226 passedclient_loopback) and the miss path (node_origin_pullwindow pull-through)cargo clippy --workspace --all-targets --all-features -D warnings,cargo doc -D warnings, public-api snapshot unchanged,pre-commitRUST_LOG=info,decdn_client=debug. Look forkind="slow_victim"steals, and compare lon1serve_streamsend_wait_ns/proof_wait_ns/path_cwnd/conn_lost_packets🤖 Generated with Claude Code