Skip to content

Fix recoverable manifest startup race - #107

Merged
bordumb merged 3 commits into
mainfrom
codex/recoverable-manifest-race
Aug 13, 2026
Merged

Fix recoverable manifest startup race#107
bordumb merged 3 commits into
mainfrom
codex/recoverable-manifest-race

Conversation

@bordumb

@bordumb bordumb commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Outcome

Concurrent gateway startup can no longer observe a partially written recoverable-development manifest.

Root cause

The first process created the final manifest path before writing and syncing its bytes. A losing process could see that path during the write window, read an empty document, and fail JSON parsing. The protected AWS atomic replay run reproduced this under real process contention: auths-dev/auths-field-lab run 31745824077.

Fix

  • write and sync each candidate manifest at a private temporary path
  • publish the completed file with an atomic, non-overwriting hard link
  • let losers read only the fully published final inode
  • remove every losing candidate
  • cover 100-way startup contention in TypeScript and Python

The final manifest remains mode 0600; corrupt completed manifests still fail closed.

Validation

  • TypeScript build passes
  • Python lint and formatting pass
  • authoritative cross-platform/package validation delegated to CI

@bordumb
bordumb merged commit 8839ec7 into main Aug 13, 2026
33 checks passed
@bordumb
bordumb deleted the codex/recoverable-manifest-race branch August 13, 2026 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant