Skip to content

session prune: a crash in publishCoordinationIdentity leaves staging files in the sessions root #431

Closed

Description

@ElbertePlinio

Found while fixing #414 (PR to follow), by reading packages/core/src/takeover.ts.

publishCoordinationIdentity writes the takeover identity to a staging file .takeover-identity-<uuid> in the sessions root, through writeFileAtomic, which uses its own write temp. It links the staging file to .<id>.takeover-identity and unlinks it in finally. If the process dies between the write and that unlink, the staging file stays, and a death inside writeFileAtomic can leave its temp. session prune does not know these names, so they stay forever.

The files hold only a directory identity, no secret, and they block nothing, so this is cleanup, not an active bug.

  • Let prune remove a .takeover-identity-<uuid> staging file, and its write temp, when it is older than the one-day marker horizon and its writer is gone
  • Test a staging file left by a killed writer
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