Skip to content

session prune: a crash before rmdir leaves an empty session directory forever #414

Closed

Description

@ElbertePlinio

Found in the council review of the fix for #317.

pruneSessionLogs removes a retained session directory in three steps: the log files, then stopped.json, then the directory. A crash after stopped.json is gone and before rmdir leaves an empty directory with no stopped.json. Later prunes skip it because they read the teardown time from that file, so the directory stays forever.

After #317, that directory also keeps the session's input closure and takeover identity markers, because a data directory means teardown may still be pending. The state is safe, but it never shrinks.

  • Let prune remove an empty session directory that has no record, lock or stopped.json, after the marker horizon
  • Test the crash point between the stopped.json unlink and rmdir

Activity

  1. ElbertePlinio commented on Oct 28, 2026

    @ElbertePlinio
    MemberAuthor

    The council review of the #317 fix found a second way to reach the same state. A first permit or lease caller for a session with no takeover identity re-reads the record and then creates the session directory and identity. If that caller stalls between the two steps for longer than the one-day marker horizon, while teardown and prune run, it recreates a directory with no stopped.json and a new identity. The permit fails and no input is delivered, but prune never removes them.

    The fix for this issue should cover both: a session directory with no record, no lock and no stopped.json, older than the horizon, holding only coordination files.

    • Also prune a coordination-only directory and its identity left by a stalled first caller
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