Skip to content

fs origin: absence and fault visibility gaps #2801

Closed

Description

@yigitdot

Found while reviewing #2793 (#2775). None of these come from that PR; each was already in crates/cache/src/origin/fs.rs or the engine paths that read it. In each case an operator gets no warn-level signal, or the node announces something it cannot serve.

1. A dangling symlink reads as an authoritative absence. FilesystemOrigin::resolve_regular maps a NotFound from canonicalize to Ok(None). That includes a leaf symlink whose target is missing, or out of the base on a host where the target path does not exist, for example after the origin tree was bind-mounted into a container with absolute links. size() then returns Ok(None), which the trait contract treats as authoritative: it is memoised as Absent, declined to paying clients, and dropped from the rescan and the DHT republish walk, with no log at any level. The comment in size() that calls this "an unknown size: degrade" is also wrong. Fix: on NotFound, symlink_metadata the leaf, and return Permanent if it is a symlink. A dangling symlinked shard directory needs the same check on base/{shard}.

2. An outboard over the cap is dropped silently. fetch_outboard returns Unsupported when the .obao4 length exceeds outboard_max_bytes (that is, expected_len + 64), and the engine treats that as a quiet decline. A wrong-length outboard under the cap logs a warn at the engine's length gate, but one over the cap never reaches it. An operator whose tool writes chunk-level outboards (about 16 times larger) silently loses range pulls on every blob. http.rs and s3.rs do the same on content_length > max. Fix: warn with the path or key, the length and the cap, before each oversize Unsupported.

3. A probe fault's cause stays at debug. In CacheEngine::probe_origin_chain_classified, a size() error is logged at debug only. The later warn ("origin probe faulted; memoising the fault") names neither the origin error nor the path. With the default origin-only gate, a symlink escape ("resolves to … which is outside base") never shows up without debug logging. Fix: carry the last per-origin error into that warn, or log non-transient faults at warn in the loop.

4. An unreadable regular file is reported as present. resolve_regular only stats. A data object with mode 0600 owned by another user gets Some(len) from size(), so the rescan announces it and the probe answers has_blob, and every serve then fails Permanent at open. Fix: size() opens and drops the file once (a FIFO is already ruled out by is_file).

5. ESTALE is Permanent. classify_io_error treats it as permanent. On an NFS-backed base it usually clears on the next path lookup, which canonicalize does on every call. As Permanent it drops the hash for a whole rescan interval.

6. Stale docs in fs.rs. The cap_at_max_bytes doc and the fetch comments say an overrun surfaces as CacheError::OriginError. It is a BlobTooLargeMarker that the engine turns into CacheError::BlobTooLarge. The same doc says path_for_log is captured for the error message, while the function body says the path is deliberately left out of the error.

Done when each item is fixed or ruled out, with a test for 1, 2 and 4.

Activity

  1. added
    kind:bug
    prio:medium
    area:cache
    on Oct 31, 2026
  2. moved this from Backlog to In progress in deCDNon Nov 1, 2026
  3. added a commit that references this issue on Nov 1, 2026
  4. moved this from In progress to Done in deCDNon Nov 3, 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