Skip to content

core: a teardown killed while writing stopped.json blocks later log pruning #315

Closed

Description

@ElbertePlinio

Found in review of PR #314 (#313).

retainSessionLogs in packages/core/src/session-retention.ts writes stopped.json with DirHandle.writeFileAtomic, whose temp is .stopped.json.tmp-<pid>-<n>. If teardown is killed between the temp open and the rename, the temp stays in the session directory. A later successful teardown writes stopped.json, but pruneDirectory sees the temp as unknown data and skips that retained session forever. #313 handles the same class for lease staging files only.

  • Remove orphan stopped.json temps when session logs are retained
  • Keep refusing to prune directories with other unknown files
  • Test: a retained session with an orphan stopped.json temp is pruned

Activity

  1. added
    bug
    on Oct 8, 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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions