Skip to content

session prune: a short stall during teardown leaves permits/ in a retained session directory forever #434

Closed

Description

@ElbertePlinio

Found in the council review of the fix for #414 (branch fix/414-prune-empty-session-dir).

A first permit caller for a session with no takeover identity re-reads the session record, then creates the session directory and its identity (packages/core/src/takeover.ts). If it passes the record check and stalls only while teardown runs, then resumes before prune, it finds the retained directory (with stopped.json and the logs), creates permits/ inside it, publishes an identity marker, and fails closed. The retained directory now holds permits/, which the normal prune path does not allow, so prune keeps the directory and both markers forever.

No input is delivered, so this is safe, but it is the same symptom as #414 and needs a shorter stall than the routes #414 fixes. A reviewer reproduced it with a script against the branch: after the caller resumed, the directory held permits, stopped.json and xvfb.log, and prune returned nothing even after everything was backdated.

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