fix(orchestrator): carry a failed batch's reason to the request error log - #616
Merged
Conversation
behinddwalls
marked this pull request as ready for review
August 19, 2026 05:52
behinddwalls
marked this pull request as draft
August 19, 2026 19:54
behinddwalls
force-pushed
the
preetam/batch-failure-reason
branch
from
August 20, 2026 01:01
d3362f0 to
20480c1
Compare
behinddwalls
force-pushed
the
preetam/batch-failure-reason
branch
from
August 20, 2026 03:47
20480c1 to
c9a98b5
Compare
… log ## Summary ### Why? When a batch failed, every request in it terminated as `error` with an empty message: mergesignal and speculate recorded only the terminal batch state, and conclude terminated the request with an empty reason — so a "did not land: error" carried no diagnostic at all. The reason is known at the failure site, but the requests are terminated later, in conclude. ### What? Carry the failure reason to conclude on the fan-out message's metadata rather than persisting it as batch state. mergesignal stamps the merge result's reason (or "merge failed" when it is empty) and speculate stamps "no speculation path could pass"; conclude reads it from the message and passes it to TerminateRequest, which already writes it to the request's terminal log. The landed and cancelled paths carry no reason, exactly as before. This mirrors the dead-letter path, which already sources its reason from the delivery context. Message metadata is durably persisted and redelivered by the queue backend, so the reason survives at-least-once retries — and the batch entity stays purely structural, with no new field and no schema migration. A `publish.MessageWithMetadata` helper and a shared `topickey.MetadataKeyFailureReason` constant carry the wiring. ## Test Plan ✅ `bazel test //submitqueue/orchestrator/...` (14/14). Updated tests assert the reason rides the conclude message metadata (mergesignal, speculate finalize) and reaches the request's terminal log (conclude). Broad build and CI gates (gazelle / tidy / mocks / fmt) clean.
The final "N request(s) did not land" line printed only id=status, so a failure read as "demo-queue/630=error" with no reason — even once the orchestrator began recording one on the request's terminal log. Append the request's last error to each failed entry when it has one, so a watched or scripted run reports why a change did not land, not only that it did not.
behinddwalls
force-pushed
the
preetam/batch-failure-reason
branch
from
August 20, 2026 13:45
c9a98b5 to
c28c014
Compare
behinddwalls
marked this pull request as ready for review
August 20, 2026 13:45
mnoah1
approved these changes
Aug 20, 2026
Jal-Bafana
pushed a commit
to Jal-Bafana/submitqueue
that referenced
this pull request
Aug 23, 2026
…changes (uber#615) ## Summary Add -burst (Makefile BURST=false) which, for independent changes, creates every change first and only then fires all the Land calls together, so the requests reach the queue in one burst instead of being enqueued as each is created. It works for every provider: burst runs each source through the same two phases, so fake creates instantly, github creates concurrently, git creates serially on its single work tree — and in all three the enqueues arrive together once creation is done. Burst does not make creation faster; with the git source it is still serialized on one work tree. It only separates creation from enqueuing so the publishes are not spread across the creation phase. The default is unchanged — each change lands the moment it exists, so the queue starts working during creation. A small lander seam lets the two-phase ordering be tested without a live gateway. ## Test Plan ✅ New unit test asserts nothing is enqueued until every change is created, provider-agnostically (a `lander` seam + a recording source stand in for any provider); shape banner covered; existing `//service/submitqueue/demo/requests` tests green. ## Stack 1. @ uber#615 1. uber#616
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.
Summary
Why?
When a batch failed, every request in it terminated as
errorwith an empty message: mergesignal and speculate recorded only the terminal batch state, and conclude terminated the request with an empty reason — so a "did not land: error" carried no diagnostic at all. The reason is known at the failure site, but the requests are terminated later, in conclude.What?
Carry the failure reason to conclude on the fan-out message's metadata rather than persisting it as batch state. mergesignal stamps the merge result's reason (or "merge failed" when it is empty) and speculate stamps "no speculation path could pass"; conclude reads it from the message and passes it to TerminateRequest, which already writes it to the request's terminal log. The landed and cancelled paths carry no reason, exactly as before.
This mirrors the dead-letter path, which already sources its reason from the delivery context. Message metadata is durably persisted and redelivered by the queue backend, so the reason survives at-least-once retries — and the batch entity stays purely structural, with no new field and no schema migration. A
publish.MessageWithMetadatahelper and a sharedtopickey.MetadataKeyFailureReasonconstant carry the wiring.The demo client's run summary also surfaces the reason, so a failed request reads
id=error: <reason>instead of a bareid=error.Test Plan
✅
bazel test //submitqueue/orchestrator/...(14/14). Updated tests assert the reason rides the conclude message metadata (mergesignal, speculate finalize) and reaches the request's terminal log (conclude). Broad build and CI gates (gazelle / tidy / mocks / fmt) clean.Stack