Repository navigation
Description
Summary
On the cdn/client/v1 serve-miss path, a hard backend fault during a reactive pull-through fill (a real CacheError::OriginError / CacheError::Store — e.g. an S3 5xx after retry-exhaustion, an open circuit breaker, or an fs I/O error) is currently swallowed to "not filled" and terminates as a signed ServeRejectReason::CacheMiss (wire NotFound) to the paying client, rather than a transient InternalError.
A signed NotFound is client-authoritative — the client treats it as "the blob is genuinely absent" and stops asking. So a transient outage of an origin the node can serve fine once it recovers tells paying clients to give up.
This surfaced in the multi-agent review of #1128 (silent-failure finding, HIGH). It was not introduced by #1128 — it is the established, documented behavior of the node→node reactive path, and #1128's new local-origin tier faithfully mirrors it. Filing so the semantics can be fixed deliberately across both tiers.
Where
Both reactive-fill helpers on crates/node/src/handlers/client.rs return a bare bool and classify a hard engine error as false:
try_pull_through(node→node, reputation: outbound report capture + selection-consumes-reputation (gated on node-to-node pull-through orchestration) #831) — the genericOk(Err(e))arm metersnode_pull_through_error, warns, returnsfalse. Its own doc says "the client still gets aNotFound, but the operator can see it happened."try_local_populate(local-origin, cache: reactive local-origin pull-through is coupled to node_to_node_pull_through_enabled #1116) — identical generic arm.on_local_populate_timeout/on_pull_through_timeout— the post-deadlinehaserror arm likewise degrades tofalse.
false is indistinguishable from a clean miss to serve_stream, which then emits ServeRejectReason::CacheMiss when no further tier fills.
This contradicts the invariant the same file already honors for the top-level store has lookup (client.rs ~line 1051): "a store fault … must not masquerade as a signed NotFound — a paying client would treat that as authoritative and stop asking. Surface it as InternalError and log." The distinction: the has-gate honors it; the reactive-fill helpers do not.
Impact
- Cache-only operators (node→node OFF) — exactly the cache: reactive local-origin pull-through is coupled to node_to_node_pull_through_enabled #1116 target class serving their own fs/http/s3 origin — a transient origin outage ships a signed
NotFoundto paying clients, who then stop requesting a blob the node will serve once the origin recovers. - Relay/node→node operators — same, when the upstream pull hits a hard fault and there is no further tier.
Note: falling through to a further tier (e.g. node→node after a local fault, when node→node is on) is fine — that's a legitimate alternative source. The defect is only the terminal classification when no tier fills.
Proposed change
Distinguish "clean miss (fall through / terminal NotFound)" from "hard fault (terminal InternalError)" on the reactive-fill path, for both tiers consistently:
- Change
try_pull_through/try_local_populate(and the timeout helpers) to return a tri-state instead ofbool— e.g.enum FillOutcome { Filled, CleanMiss, HardFault }. - In
serve_stream, when no tier fills: emitCacheMissforCleanMiss, butInternalErrorforHardFault(mirroring the top-levelhas-error handling), so a transient fault stays retryable. - Keep the existing
node_pull_through_errormetering.
Acceptance
- A hard
OriginError/Storefault on the only available reactive tier terminates asInternalError(retryable), not signedNotFound. - A genuine absence (
NotFound/NoOrigin) still terminates asCacheMiss. - Applied uniformly to node→node and local-origin tiers.
- Tests: hard-fault-yields-InternalError (cache-only + node→node), clean-miss-yields-CacheMiss regression.
References
- feat(node): complete reactive origin pull-through — decouple local populate + node→node chained binding (#1116, #1117) #1128 (introduced the local-origin tier that mirrors this behavior), reputation: outbound report capture + selection-consumes-reputation (gated on node-to-node pull-through orchestration) #831 (node→node reactive pull-through), cache: reactive local-origin pull-through is coupled to node_to_node_pull_through_enabled #1116.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
fix(node): correct the fault classification, and the claims made for …
fix(node): don't sign an authoritative NotFound for a backend fault o…
fix: bound the requester's fetch loop, and classify what comes back (#…
fix(node): review round — metric contracts, exhaustive cause match, P…
feat(node): lean positive probe cache (ADR 001, 15s TTL, no evidence …
fix(node): refuse InternalError for local-fault pull failures, not No…
fix(node,cache): address PR review — always-set pull_result on runtim…
feat(node): route own-origin serve-miss through the two-leg driver; d…
fix(cache,node): a size probe that ends on transport faults reports a…
feat(node): stream bounded and resumed cache-miss requests through th…