Repository navigation
fix(lifecycle): read a phase event's "now" after taking the writer - #109
Merged
Merged
Conversation
record_phase_event read the implicit effective instant before waiting for the write lock, then refused anything older than the newest committed event as out of order. A request that waited across a second boundary while another event committed got OutOfOrder instead of the real answer. It now reads "now" (and checks for a future instant) under the lock. Closes #108 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TsvZjbz8dTRM8A1NqAP5ts
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Member
Author
|
Full local proof on Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Primary Issue
Closes #108
Problem And Outcome
record_phase_eventread the implicit effective instant (now) beforestorage::write_txwaited for the writer. Inside the transaction, it then refused any event older than the newest committed one asOutOfOrder. So a request that waited across a second boundary while another event committed gotOutOfOrderinstead of the real answer.This failed
pr-gateon #106 inphase_events_validate_the_committed_pause_statewithleft: OutOfOrder, right: AlreadyPaused(job). That PR doesn't touch lifecycle.Now "now", and the future-instant refusal, are read after the writer is held, so a request is judged at the moment it can commit. Explicit back-dated events keep the effective-order refusal unchanged.
Changes
lifecycle.rs:write_txfirst, thennow/effectiveandEffectiveInFuture, which now returns throughstorage::refuse(tx, …).tests/write_transactions/training.rs: new deterministic testa_present_phase_event_is_judged_after_waiting_for_the_writer.AlreadyPaused.CHANGELOG.md: Unreleased → Fixed.Correction rung: 2. A deterministic test pins down the timing the flaky concurrency test only hit by chance.
Verification
left: Err(OutOfOrder),right: Err(AlreadyPaused)).write_transactions: 22 passed. fmt and clippy are clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01TsvZjbz8dTRM8A1NqAP5ts
Generated by Claude Code