openai / openai/codex

Serialize concurrent rollout writers before assigning paginated ordinals

Open
#40,109 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug CLI session
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the RolloutRecorder append path and trace how paginated ordinal state is read and updated. Reproduce the two-recorder resume case, then run or extend the regression test so append batches, including the cold path, produce contiguous, unique ordinals without projection mismatches.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.