Repository navigation
fix(projects): never abandon an admitted ProjectOps write on caller cancellation - #89
Merged
Merged
Conversation
…ancellation Checkpoint before the fix; --no-verify because the tests are red by design. Refs #85 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ancellation Create, Update, RotateToken and NarrowForEnrolment read their queued closure's results after return, but ran through runQueued, which returns ctx.Err() while the closure may still commit. A cancelled RotateToken could store a new token the caller never received. They now use runCommitted. Refs #85 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Owner
Author
|
Merged by the coordinator under the owner's delegation (tokens): CI test and race green on 70c3325, review round 1 clean; reviewer questions answered in the contract. |
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.
Closes #85
ProjectOps.Create,Update,RotateTokenandNarrowForEnrolmentread their queued closure's results after it returns, but ran throughrunQueued(Queue.Do). That returnsctx.Err()on cancellation while the closure may still commit. The effect was a data race on the result variables and a failure reported for a write that happened. Worst of all, a cancelledRotateTokencould store a new token the caller never received. All four now userunCommitted(Queue.DoCommitted).errProjectTokenUnrecorded) is unchanged: it commits and withholds the token.Tests (red first,
cmd/relay/project_ops_commit_race_test.go,-race): for each of the four methods, the store write is blocked after the step is queued, the caller is cancelled, and the write is released. The method must then return the committed result, and the store must agree.RotateTokenpins that the caller either gets the stored token or storage is unchanged.Break-and-restore on
RotateToken. Review round 1 was clean. Fullgo test ./...passed locally with Relay stopped. The same bug in sibling ops is #87.🤖 Generated with Claude Code