Repository navigation
fix(stovepipe): key build-slot ownership by request ID - #966
Open
sbalabanov wants to merge 1 commit into
Open
sbalabanov wants to merge 1 commit into
sbalabanov wants to merge 1 commit into
Conversation
sbalabanov
force-pushed
the
sergeyb/sp-oct-003-owner-keyed-slots
branch
from
October 27, 2026 23:36
0ef6b68 to
c404a3a
Compare
Replace the queue's anonymous in_flight_count with in_flight_request_ids, the set of requests holding a build slot. A redelivery that finds its own claim resumes the admit instead of holding behind it, or, when a newer head arrived, releases the slot before being superseded, so a crash between the claim and the processing write no longer wedges the queue. Release removes by ID and is a no-op when absent, so a retried outcome write cannot free another request's slot, and the DLQ releases for any nonterminal request. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
sbalabanov
force-pushed
the
sergeyb/sp-oct-003-owner-keyed-slots
branch
from
October 27, 2026 23:39
c404a3a to
beeea87
Compare
sbalabanov
marked this pull request as ready for review
October 27, 2026 23:41
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.
Why?
Admission claims a build slot by incrementing an anonymous
in_flight_countand then moves the request accepted→processing in a second write. If the second write never lands, the count stays raised and the redelivery is held behind its own claim. Holds never dead-letter, and the DLQ releases onlyprocessingrequests, so nothing repairs it. Release has the same problem in reverse: after a failed outcome write, the retry releases a second time and takes another request's slot.max_concurrent = 1; request R is accepted and becomes the latest head.processclaims the slot (in_flight_count = 1), then crashes before writingprocessing.What?
Queue.InFlightCountbecomesInFlightRequestIDs, the set of requests holding a slot, stored in MySQL asin_flight_request_ids JSON NOT NULL DEFAULT (JSON_ARRAY()). A claim is idempotent per request ID. A redelivery that finds its own ID resumes the processing write. If a newer head arrived meanwhile, it releases the slot before being superseded, so no slot is spent on a stale head and no sweeper is needed. Release removes by ID and writes nothing when the ID is absent. That makes the buildsignal and DLQ retries safe and lets the DLQ release for any nonterminal request. A claim left by a failed admit stays for the redelivery to resume or the DLQ to release.processreleases it only when it loses the admit to a terminal transition; a duplicate admission keeps the slot. The process RFC, related step docs and the storage README (with an upgrade note) describe the owner set.Test Plan
make fmt && make lint && make check-tidy && make check-gazelle && make check-mocks./tool/bazel test //stovepipe/... //service/stovepipe/... //test/integration/stovepipe/extension/storage/... --test_output=errorsAudit: SP-OCT-003 and SP-OCT-005 in doc/audit/stovepipe-fable-v2.md (Sol v2 #1/#2, Opus v2 #1/#8).
🤖 Generated with Claude Code