Skip to content

fix(node): log every serve-miss refusal once at info, naming its path - #2314

Merged
thiras merged 3 commits into
mainfrom
fix/2282-miss-refusal-logging
Oct 5, 2026
Merged

thiras merged 3 commits into
mainfrom
fix/2282-miss-refusal-logging

Conversation

@thiras

@thiras thiras commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A node refuses paid requests with wire NotFound (or InternalError) through several serve-miss exits. Only the coverage gate logged at info, so in the 2026-10-01 testnet pulls hel1 counted +34 decdn_serve_stream_rejected_cache_miss_total and Loki had no line for any of the client's 18 refusals.

Every cache-miss refusal now goes through respond_miss (wire.rs). Once the refusal is sent, it logs one info line, serve-miss: refusing the request, with these fields:

  • hash, byte_offset, byte_len
  • reason: the same value the serve_stream span records
  • path: one of the values below
path exit extra fields
coverage_gate the ranked candidates do not cover the pull range (#2195) pull_offset, pull_len, candidates, first_uncovered_chunk
pull_leg_miss the pull-leg open ended without a target cause: clean_miss, below_margin or local_fault
pull_leg_timeout the pull-leg open ran past its deadline
buffered_miss the buffered pull-through ran and did not fill the blob
no_pull_through node-to-node pull-through is off (the local-origin tiers may have run)
no_lane no binding, or no lane here, so no fill tier ran suppressed; throttled to one line per minute, because any peer can reach this path

Other details:

  • No line is logged when the refusal fails to send. The error context names the path, and the dispatch sink logs the node fault.
  • The wire answer and the reject counters do not change.
  • I used a log line instead of a counter label. The repo uses sibling counters rather than labels, and the issue needs per-request detail (hash and range).

Closes #2282

Test plan

  • Unit tests (wire.rs):
    • each path's name;
    • InternalError is chosen only when a tier faulted;
    • the line's fields for a pull-leg miss with a cause, a coverage-gate shortfall, and a throttled no_lane line.
  • Integration tests assert exactly one refusal line, with the expected path and reason:
  • cargo nextest run -p decdn-node: 1582 passed
  • cargo clippy --workspace --all-targets --all-features -- -D warnings, cargo doc -D warnings, cargo fmt --check, pre-commit hooks

🤖 Generated with Claude Code

…#2282)

A node refused paid requests with NotFound through five miss exits, but
only the coverage gate logged at info. The others ticked
decdn_serve_stream_rejected_cache_miss_total and nothing else, so an
operator could not see which hash or range was refused, or why.

Each terminal miss now goes through respond_miss, which logs
"serve-miss: refusing the request" with hash, byte_offset, byte_len,
reason and path (coverage_gate, pull_leg_miss, pull_leg_timeout,
buffered_miss, no_pull_through), then sends the same refusal as before.
The coverage gate's detail line moves to debug so each refusal logs
once. The wire answer and the reject counters do not change.

Closes #2282

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 5, 2026 11:11
@thiras thiras self-assigned this Oct 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The new log can report a refusal even when response signing or writing fails and the stream is recorded as a node fault.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds consistent INFO-level logging for all serve-miss refusal paths without changing wire responses or metrics.

Changes:

  • Adds stable miss-path classification and centralized refusal logging.
  • Routes windowed and buffered misses through respond_miss.
  • Adds logging tests and updates documentation.
File Description
CHANGELOG.md Documents serve-miss logging.
crates/​node/​src/​handlers/​client/​dispatch.rs Classifies buffered and unavailable pull-through misses.
crates/​node/​src/​handlers/​client/​mod.rs Defines miss paths and refusal metadata.
crates/​node/​src/​handlers/​client/​outcome.rs Exposes refusal reason formatting internally.
crates/​node/​src/​handlers/​client/​window.rs Classifies windowed miss exits and lowers detail logging to DEBUG.
crates/​node/​src/​handlers/​client/​wire.rs Adds centralized INFO logging and tests.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread crates/node/src/handlers/client/wire.rs Resolved
A signing, encoding or node-side write fault returns Err from
respond_error, and the dispatch sink counts it as a node fault. Logging
before the send claimed a NotFound answer the node never gave.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-code-quality

github-code-quality Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Code Coverage Overview

Languages: Rust

Rust / code-coverage/cargo-llvm-cov

The overall line coverage in commit cbca7b8 in the fix/2282-miss-refusa... branch remains at 87%, unchanged from commit fc23654 in the main branch.

Show a line coverage summary of the most impacted files.
File main fc23654 fix/2282-miss-refusa... cbca7b8 +/-
crates/node/src.../client/wire.rs 96% 95% -1%
crates/node/src/dht/publish.rs 92% 92% 0%
crates/client/src/lib.rs 92% 92% 0%
crates/node/src...gin/pull_leg.rs 91% 91% 0%
crates/client/src/scheduler.rs 95% 95% 0%
crates/cli/src/.../bundle_pull.rs 81% 81% 0%
crates/node/src...lient/window.rs 76% 76% 0%
crates/client/s...c/connection.rs 97% 97% 0%
crates/cache/src/engine.rs 94% 94% 0%
crates/node/src...s/client/mod.rs 95% 95% 0%

Updated October 05, 2026 11:50 UTC

Review follow-ups on the serve-miss refusal line:

- A request with no binding or no lane here ran no fill tier and logged
  an unthrottled info line as no_pull_through, so any peer could write
  one line per stream. It now refuses on its own no_lane path, logged
  through a one-per-minute throttle with a suppressed count.
  no_pull_through now means only that node-to-node pull-through is off.
- The coverage-gate line carries pull_offset, pull_len, candidates and
  first_uncovered_chunk, so the detail stays at info and the separate
  debug line is gone.
- A pull_leg_miss line carries the PullMiss as cause (clean_miss,
  below_margin, local_fault), so a buy-ceiling decline reads apart from
  an absent blob.
- A refusal that fails to send names its path in the error context.
- The test SpanCapture records decdn_node INFO+ events; the loopback
  fault matrix and the #2195 no-covering-candidate cases assert the one
  refusal line and its path, plus a new unbound-miss no_lane test.
- MissPath docs and the CHANGELOG entry say what each path covers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

node: most cache-miss refusals log nothing at info, so an operator cannot see why a node answered NotFound

2 participants