Conversation
Restrict pause to pending executions so pause/resume cannot release a running worker's claim and let a second worker enter the purchase path. Cover both race orders, queue redelivery, actor state, and history with real PostgreSQL and synthetic provider boundaries. Closes #223
Contributor
|
Warning Review limit reached
This review includes 6 billable files and costs up to $1.50.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 29 minutes for your next included review. View limit detailsLimit details: You’ve used the included review currently available. Your 75 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. Review configuration: ⚙️ Run configurationConfiguration used: Repository: LeanerCloud/cloud-commitments-platform/.coderabbit.yaml Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (6)
Comment |
This branch has not been deployed
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.
Pausing an execution already claimed by a worker changed it from running to paused. Resuming made it pending again, allowing a second worker to enter the purchase while the first was still active. Restrict Pause to pending executions so the atomic status transition preserves the worker's claim. Pending pause/resume remains supported; ineligible states return 409, now documented on the endpoint.
Closes #223
Independent gpt-6-astra review approved exact commit
1c5a14964444ed1015dee47346e875809e616ac8under the authorized local review alternative, with no actionable findings in both implementation rounds or final committed-source review.Fresh independent PostgreSQL 16 race-enabled tests exercised the production handler, store and Manager.ProcessMessage with synthetic provider, credential, auth-session and email boundaries. They assert both claim/pause orderings, unchanged claim attribution, one provider purchase and one persisted history row, queued redelivery safety, and legitimate pending pause/resume. The committed regression against the parent handler failed on two provider entries and two history rows; removing pending from the allowed set failed the valid pause control. Four connected scenarios also passed three independent race-enabled repetitions before commit.
The full untagged race suite, backend build and normal installed hooks passed. No live-cloud purchase was performed. CI is a separate publication gate.