Serialize concurrent rollout writers before assigning paginated ordinals
Open 💬 2 comments Opened Aug 22, 2026 by bjornfix
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
Two independent RolloutRecorder instances can resume the same paginated rollout, each read the same tail ordinal, and append duplicate ordinals. The rollout projection then fails with an ordinal mismatch even though the JSONL remains syntactically valid.
This patch fixes the owning writer seam by taking an OS-level exclusive lock for each append batch, refreshing ordinal state from the durable tail while locked, and applying the same protection to the cold append path. It also adds a regression test that resumes two recorders and asserts the resulting ordinals are contiguous and unique.
The patch contains no rollout contents, credentials, or account-specific configuration.
2 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
This writer-race hypothesis matches a Windows/Desktop incident where a reboot/reopen boundary produced token_count and thread_settings_applied with the same ordinal. A safe cleaner must require full writer absence, preserve the canonical suffix, and fail closed on any unknown duplicate; see #35746 and #40178.