Skip to content

session prune: a concurrent prune can abort in carryStoppedAt after the markers are gone #453

Closed

Description

@ElbertePlinio

Found in the council review of PR for #431 and #434 (branch fix/431-434-prune-leftovers); the code is unchanged from main.

carryStoppedAt in packages/core/src/session-retention.ts lstats and then opens each id marker in the sessions root without handling ENOENT. When two prunes run at once, a slower one can reach carryStoppedAt after a faster one has removed the retained directory and run pruneMarkers. The marker is gone, so the slower prune throws and its whole run aborts through runReported, dropping the list of ids it had already pruned. No data is at risk: the faster prune finished the work.

  • Treat a marker that a concurrent prune removed as done in carryStoppedAt, as unlinkStaleFile already does
  • Test two concurrent prunes that interleave at that point

Activity

  1. ElbertePlinio commented on Oct 29, 2026

    @ElbertePlinio
    MemberAuthor

    Found in the council review of PR #455.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions