Repository navigation
fix(node): name the walk on a pull_leg_miss refusal and give the upstream probe one second - #2533
Merged
Merged
Conversation
A `serve-miss: refusing the request` line on the `pull_leg_miss` path said only `cause=clean_miss`. The fleet logs at info, so a refusal could not say whether discovery named nobody, every candidate was skipped or unreachable, the holders did not span the blob, or every handshake failed. The open questions in #2366 are exactly those. `open_pull_leg` returns a `PullLegMiss { miss, trail }`. The `PullLegTrail` records where the candidate list came from (`source`: cache, dht, directory, none), its size (`discovered`), what the probe rounds saw (`skipped`, `probed`, `unreachable`, `absent`, `dropped`, `holders`, `spans`) and what the handshake walk did (`handshakes`, `last_fault`). The refusal line records every field, and every serve-miss refusal line now carries the request's `namespace_id`. - `probe_candidate` returns `Result<Candidate, ProbeDrop>`; the round tallies each drop under its arm. Side effects are unchanged. - `discover` returns `Discovered { providers, source }`. - `handshake_total_bytes` returns a `HandshakeFault { miss, why }`; `PullVerdict::as_str` and `PoolOpenArm::as_str` name the fault. - The buffered `Origin::fetch` path passes a throwaway tally. Refs #2366 Co-Authored-By: Claude Fable 5.1 <[email protected]>
`PROBE_TIMEOUT` was 500 ms. A probe dials a fresh connection and the protocol has no 0-RTT path, so every probe costs two RTTs plus the connection handshake. At inter-continental RTTs that sits at or past 500 ms, so a node whose only candidate was a far origin dropped it as unreachable and signed `NotFound` for content that origin serves. On the testnet, 106 of hel1's 156 probe rounds in one day overran the old ceiling, and each `pull_leg_miss` refusal minute moved `decdn_node_pull_unreachable_total` by one. The budget is 1 s. The direct-path grace keeps its 500 ms cap, so it now has headroom instead of what is left of the exchange. The derived outer pull-through deadline at defaults is 168 s. ADR 001 § Probe response collection, ADR 005 and the observability appendix carry the figure. Refs #2366 Co-Authored-By: Claude Fable 5.1 <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
The diagnostic propagation preserves refusal semantics, and the timeout change has consistent deadline arithmetic, regression checks, and documentation.
No open issues 🎉
What changed in this PR
Improves diagnosis of node pull-through refusals for #2366 and gives distant upstream providers more time to answer probes.
Changes:
- Adds discovery, probe, and handshake details plus the request namespace to refusal logs.
- Raises the upstream probe timeout to 1 second, making the default outer deadline 168 seconds.
- Adds regression checks and updates documentation.
| File | Description |
|---|---|
| crates/node/tests/node_origin_pull.rs | Tests unreachable-provider refusal diagnostics. |
| crates/node/tests/client_loopback.rs | Checks unprovisioned pull-leg diagnostics. |
| crates/node/src/selection/tests.rs | Pins updated timeout and deadline values. |
| crates/node/src/selection.rs | Raises the probe timeout. |
| crates/node/src/node_origin/tests.rs | Tests diagnostic tally mapping and saturation. |
| crates/node/src/node_origin/pull_leg.rs | Carries discovery and handshake diagnostics. |
| crates/node/src/node_origin/mod.rs | Tracks discovery sources and probe outcomes. |
| crates/node/src/metrics.rs | Updates the histogram documentation. |
| crates/node/src/handlers/client/wire/tests.rs | Tests refusal log fields. |
| crates/node/src/handlers/client/wire.rs | Logs namespace and pull-leg diagnostics. |
| crates/node/src/handlers/client/window.rs | Propagates detailed pull-leg misses. |
| crates/node/src/handlers/client/mod.rs | Updates the refusal-path payload. |
| crates/common/src/config/types.rs | Documents the revised default deadline. |
| crates/common/src/config/mod.rs | Updates deadline documentation. |
| crates/client/src/probe/tests.rs | Updates the timeout reference in a comment. |
| crates/cli/src/commands/config.rs | Updates generated configuration comments. |
| CHANGELOG.md | Describes diagnostics and timeout changes. |
| adr/appendix-observability.md | Documents the new probe ceiling. |
| adr/005-protocol.md | Updates probe timing documentation. |
| adr/001-network.md | Updates collection timing and latency tradeoffs. |
Review effort: Balanced
This was referenced Oct 18, 2026
Closed
Code coverage overviewLanguages: Rust Rust / code-coverage/cargo-llvm-cov
View coverage of the 5 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
…equester drop Review follow-ups for the pull-leg trail. - `probe_round` returns the peers it resolved (probed or skipped), and the origin-directory supplement leaves both out. A directory origin the first round skipped as negative-cached or wedged no longer counts as `skipped` twice. Behaviour is unchanged: a second round would skip it again. - `holders` and `spans` describe the candidates the handshake walk has, after the requester drop. The directory supplement can probe the requester, and the walk drops it. - `PullLegTrail` documents that `skipped` and `probed` include the supplement round, that a cancelled probe counts in `probed` only, and that a directory list is not negative-cache filtered. - ADR 001, ADR 005 and the `PROBE_TIMEOUT` doc state one probe cost model: two RTTs, one for the connection handshake and one for the request. ADR 001 § Probe response collection is split into short sentences. - The fixture probe responder answers `has_blob` from its coverage, so a holder with no block answers `has_blob: false` as a node does; the empty blob keeps `has_blob: true`. - One journey: a directory origin that holds nothing is probed once, negative-cached, and skipped once on the next serve. Refs #2366 Co-Authored-By: Claude Fable 5.1 <[email protected]>
8 of 9 tasks
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.
What
Two commits for #2366 (bonded non-holders refusing pull-through with
pull_leg_miss cause=clean_miss).The 13 hel1 refusals in the 2026-10-18 batch are three mechanisms, not one. Cross-referencing each refusal minute with the per-minute node counters and the Tempo
dht_lookup/serve_streamspans:decdn_node_pull_unreachable_totalby one; the 12:18:39 triple is three concurrent serves whose probes of the same sole candidate failed at the same instant, while bcl was serving hel1 legs of the same blob throughoutdecdn_node_pull_no_providers_total+4 in those minutes; staker set stayed 9, directory RPC failures 0Commit 1 — a
pull_leg_missrefusal names the walk that found no targetThe fleet logs at info, and the line said only
cause=clean_miss.open_pull_legnow returns aPullLegMiss { miss, trail }, and theserve-miss: refusing the requestline records thePullLegTrail:source(cache/dht/directory/none),discovered,skipped(negative-cached or wedged before probing),probed,unreachable,absent(has_blob: false),dropped(shed, unverifiable, inconsistent, no address),holders,spans,handshakes, andlast_fault(the last handshake's verdict or pool-open arm). Every serve-miss refusal line also carries the request'snamespace_id, which settles whether the four no-providers refusals were namespace-0 requests.probe_candidatereturnsResult<Candidate, ProbeDrop>; the probe round tallies each drop. Side effects are unchanged.discoverreturnsDiscovered { providers, source }.handshake_total_bytesreturns aHandshakeFault { miss, why };PullVerdict::as_strandPoolOpenArm::as_strname the fault.Commit 2 — the node's upstream probe budget is 1 s
PROBE_TIMEOUTwas 500 ms. A probe dials a fresh connection, so it costs two RTTs plus the connection handshake, andselection.rsalready named this as "the first term to revisit if distant-region selection looks too sparse". hel1'sdecdn_probe_collection_latency_secondsfor the day: 25 rounds ≤ 0.25 s, 50 ≤ 0.5 s, 156 ≤ 1 s, so 106 of 156 rounds overran the old ceiling. At 1 s the direct-path grace keeps its 500 ms cap with headroom, and the derived outer pull-through deadline at defaults is 168 s (was 167.5 s). ADR 001 § Probe response collection, ADR 005 and the observability appendix carry the figure.Refs #2366. Not
Closes: mechanism A is fixed and B/C are instrumented; the reporter's note stands that verification needs a blob the fleet has not cached.Commit 3 — review follow-ups
A directory origin the first round skipped (negative-cached or wedged) was counted as
skippedagain by the origin-directory supplement;probe_roundnow returns the peers it resolved, and the supplement leaves them out.holders/spansare taken after the requester drop. ADR 001 / ADR 005 /selection.rsstate one probe cost model (two RTTs: the connection handshake and the request). The fixture probe responder answershas_blobfrom its coverage, and a new journey pins the single count.Not in this PR
DHT_CLIENT_TIMEOUT == DEFAULT_ROUND_TIMEOUT(8 s), so a third of the fleet's lookups wait the full round. Everydht_lookupspan sampled on hel1 for the SDXL blob ran exactly 8.00 s.discoverfalls back to the directory only on an empty DHT answer, and the requester is dropped afterwards, so a DHT answer naming only the requester refuses without asking the directory (pre-existing; the trail shows it assource=dht discovered=0).Reviewer notes
PullLegTrailandopen_pull_legincrates/node/src/node_origin/pull_leg.rsfirst, thenProbeTally/probe_roundinnode_origin/mod.rs.log_miss_refusalinhandlers/client/wire.rsis the only consumer.Origin::fetchpath passes a throwaway tally; its refusal isbuffered_miss, not this line.holderscounts what the rounds admitted, before the requester drop.source;handshakescounts both walks (documented on the type).Verification
cargo fmt -- --checkcargo clippy --workspace --all-targets --all-features -- -D warningsCARGO_BUILD_WARNINGS=deny cargo doc --workspace --no-deps --document-private-itemscargo nextest run -p decdn-node --no-fail-fast(1710 passed on the final tree)cargo nextest run -p decdn-cli -p decdn-common -p decdn-clientmake -C adr check-refs;pre-commit run --files adr/001-network.md adr/005-protocol.md adr/appendix-observability.md CHANGELOG.mdan_unreachable_only_candidate_refuses_with_the_walk_on_the_line(node_origin_pull: a directory that lists only a dead peer refuses onpull_leg_misswithsource=directory discovered=1 probed=1 unreachable=1 holders=0 handshakes=0),a_negative_cached_only_candidate_is_skipped_once_per_walk(fails under the double-count mutation), twolog_miss_refusalline tests, twoProbeTallyunit tests (the arm mapping fails under mutation),probe_timeout_matches_the_adr_collection_ceilingandouter_pull_deadline_at_defaults_is_168spinned before the constant moved.pull_leg_missline in Loki carries the trail; comparedecdn_node_pull_unreachable_totalper node against today's 31/293 on hel1 and the refusal count against 13/293.CHANGELOG.mdentries added🤖 Generated with Claude Code