You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
session prune: a crash before rmdir leaves an empty session directory forever #414
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
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
Activity
ElbertePlinio commentedon Oct 28, 2026
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.jsonand 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.