Skip to content

cache: a vanished origin base directory reads as a silent per-hash absence on the probe path #2823

Closed

Description

@yigitdot

Found reviewing #2815. FilesystemOrigin::resolve_regular treats a construction-time fact as a runtime invariant: the base is canonicalized once in new(). If the base directory is deleted, or its mount disappears together with the directory, after startup — the most common shape of the bind-mount operator mistake #2801 item 1 names — canonicalize returns NotFound, dangling_link finds no symlink (both stats say NotFound), and every hash in the origin reads as an authoritative absence: the probe memo caches Absent, the serve gate signs NotFound to paying clients, and the rescan drops the whole announce set. enumerate() on a missing base does surface in the rescan's enumerate_failures count, but a serve-gate probe of one hash between rescans is fully silent.

Proposed fix: in resolve_regular's NotFound arm (crates/cache/src/origin/fs.rs), when dangling_link returns None, stat self.base; if the base itself is NotFound, return OriginPullError::Permanent(\"cache.origin.path base {} no longer exists\"). Costs one stat, and only on the absent path. Add a test that removes the base after construction and asserts size() returns Permanent.

🤖 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. moved this from In progress to Done in deCDNon Nov 16, 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