Skip to content

cache: http/s3 size() answers Ok(None) for a present object, which the probe path memoises as an authoritative absence #2827

Closed

Description

@yigitdot

Found reviewing #2815 (#2801 item 1's class, left open in the sibling adapters). The Origin::size contract — restated by the fs adapter in #2815 — reads Ok(None) as an authoritative absence: the probe memo caches Absent, the serve gate signs NotFound, and the republish walk drops the hash. But HttpOrigin::size (crates/cache/src/origin/http.rs) returns Ok(None) when Content-Encoding is set or Content-Length is absent/unparsable, and S3Origin::size (crates/cache/src/origin/s3.rs) does the same — for objects that exist. For a compressed or length-less remote origin, every probe silently reads as absent. The http comment says the case "degrades to a whole-blob pull", which is true for the range-scope caller and false for the probe/announce caller. Fix direction: a distinct "present, size unknown" answer (or an OriginPullError) so a probe does not cache an absence for an object the origin holds.

🤖 Generated with Claude Code

Activity

  1. added
    kind:bug
    prio:medium
    area:cache
    on Nov 1, 2026
  2. moved this from Backlog to In progress in deCDNon Nov 11, 2026
  3. yigitdot commented on Nov 13, 2026

    @yigitdot
    ContributorAuthor

    Obsoleted by design in #2885: the 'present, size unknown' answer this issue proposes is the tri-state that PR deleted as having no use (#2867), since an origin object without a provable size is now never served or advertised. Residual: an origin whose HEAD gives no length is an unsupported configuration — the supported path is decdn origin import, which writes {H}.sizeproof. If that ever turns out wrong, the fix is a sizeproof-based presence fallback, which deserves a fresh issue.

  4. moved this from In progress to Done in deCDNon Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cachekind:bugprio:medium

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions