Repository navigation
fix(server): a retried pull-request-state delivery never fails with 500 - #225
Merged
Merged
Conversation
The endpoint treated a thread that changed between read and dispatch as "stale", but a retry of the same delivery reuses the command id, and the engine answers a command it already rejected with OrchestrationCommandPreviouslyRejectedError. That surfaced as a 500, so the bridge would retry the delivery forever. The link-sync path had no race handling at all. Both dispatches now report either rejection as "stale". Found by a stress run on expbkt3 (27 of 160 concurrent writes returned 500). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Thread transfer impact
This comment will update automatically after the next completed run. |
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
A stress run on expbkt3 (10 concurrent pull-request-state writers against 5 threads on one branch) got HTTP 500 on 27 of 160 writes:
The endpoint (#217) treats a thread that changed between its read and the dispatch as
stale. But a retry of the same delivery reuses the same command id (bridge:pr-state:<deliveryId>:<threadId>:…), and the engine answers a command it already rejected withOrchestrationCommandPreviouslyRejectedError. That surfaced as a 500. The bridge retries failed deliveries, so it would have retried that delivery forever. Thethread.pull-request-link.syncdispatch had no race handling at all.Fix
Both dispatches now report either
OrchestrationCommandInvariantErrororOrchestrationCommandPreviouslyRejectedErrorasignored: stalewith HTTP 200. That matches the contract: "a write that lost to the thread's own changes is ignored".Evidence
treats a retried delivery whose update was rejected as stale, not a failure: it pre-records a rejected command under the retry's command id, then applies the delivery. It fails without the fix and passes with it. The suite passes (7).vp run typecheckinapps/serverand lint are clean.After it deploys I'll re-run the stress test on expbkt3 and expect 0 errors.
Model/harness: Claude Opus 5.5 via Claude Code in T3 Code.
🤖 Generated with Claude Code