feat(stovepipe): reschedule process when concurrency gate is closed#338
Open
mnoah1 wants to merge 2 commits into
Open
feat(stovepipe): reschedule process when concurrency gate is closed#338mnoah1 wants to merge 2 commits into
mnoah1 wants to merge 2 commits into
Conversation
2dc04df to
75abca6
Compare
Collaborator
|
This PR could not be automatically rebased after its base PR was merged. The rebase hit conflicts that need manual resolution. To fix manually: git fetch origin
git checkout mnoah1/stovepipe-process-gate-defer
git rebase --onto origin/main 75abca64a764251e8cd57316ebd6731ca24390b1 mnoah1/stovepipe-process-gate-defer
# resolve conflicts, then:
git push --force-with-leaseThen update this PR's base branch: gh pr edit 338 --base main |
aa2ccae to
e738ad3
Compare
Ack the current delivery and PublishAfter the same ProcessRequest when the latest head cannot claim a build slot, so gate waits do not burn MaxAttempts or block the partition.
e738ad3 to
5b651c5
Compare
mnoah1
commented
Jul 14, 2026
|
|
||
| // Suffix the message id with the publish time so the reschedule can't collide with | ||
| // the in-flight delivery's still-present message-store row. | ||
| msgID := fmt.Sprintf("%s/reschedule/%d", request.ID, time.Now().UnixMilli()) |
Contributor
Author
There was a problem hiding this comment.
Alternative considered: add a value on the payload that keeps track of reschedules. I think timestamp provides sufficient uniqueness here for now but we could consider that option as well.
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.
What?
When the gate is closed (on first check or after losing a slot-claim race), the controller now re-enqueues the same ProcessRequest to the process topic via PublishAfter(GateWaitDelayMs) and acks the current delivery.
Why?
Implementing proposed PublishAfter behavior from RFC: https://github.com/roychying/submitqueue/blob/chenghan.ying/stovepipe-build/buildsignal-doc/doc/rfc/stovepipe/steps/process.md#option-2-ack-and-publishafter
This allows us to reschedule the delivery for later processing, rather than having publish pause the goroutine to wait for the gate to open.
Test Plan
make local-stovepipe-startgrpcurl -plaintext -d '{"queue":"monorepo/main"}' localhost:32784 uber.submitqueue.stovepipe.Stovepipe/IngestDELETE FROM request_uri WHERE queue='monorepo/main';grpcurl -plaintext -d '{"queue":"monorepo/main"}' localhost:32784 uber.submitqueue.stovepipe.Stovepipe/Ingest