Skip to content

Reactive pull-through: a hard origin/store fault terminates as a signed CacheMiss (NotFound), not InternalError — both tiers #1129

Closed

Description

@thiras

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:

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

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 of bool — e.g. enum FillOutcome { Filled, CleanMiss, HardFault }.
  • In serve_stream, when no tier fills: emit CacheMiss for CleanMiss, but InternalError for HardFault (mirroring the top-level has-error handling), so a transient fault stays retryable.
  • Keep the existing node_pull_through_error metering.

Acceptance

  • A hard OriginError/Store fault on the only available reactive tier terminates as InternalError (retryable), not signed NotFound.
  • A genuine absence (NotFound/NoOrigin) still terminates as CacheMiss.
  • Applied uniformly to node→node and local-origin tiers.
  • Tests: hard-fault-yields-InternalError (cache-only + node→node), clean-miss-yields-CacheMiss regression.

References

Activity

  1. self-assigned this
    on Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions