Repository navigation
fix(server): lock operator generation state transitions - #5650
Merged
thedotmack merged 4 commits intoNov 9, 2026
Merged
thedotmack merged 4 commits into
thedotmack merged 4 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_019FbY8a4P6RjaWFnrGVZXnd
Owner
|
Merged, thank you @Afloat16! Operator retry and cancel now check and change a generation job under a row lock in one transaction, so a late retry can't reset a job that already moved on, and a cancel can't overwrite a completion that just committed. Waiting on real lock state in the tests instead of sleeps is excellent. I merged main and dropped the generated bundles. |
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.
Problem
Operator retry/cancel read state without a lock and then UPDATE unconditionally. A delayed retry can reset another request's processing/completed generation, clear its lock and republish it. Cancellation can overwrite a completion that committed between check and write. Concurrent duplicate actions also duplicate queue publication/removal and lifecycle events.
Change
After existing scope authorization, reload the generation job FOR UPDATE and keep the status check plus UPDATE in one transaction. Return existing no-op/conflict outcomes from that fresh row. Publish queue and audit work after commit. Preserve the existing explicit operator retry attempt policy.
Validation
0cc8fdf924f5589c13ea6313eb6dc8a560206fd3.