Skip to content

feat(submitqueue): Classify why a request ended in error on its terminal log - #1155

Open
roychying wants to merge 2 commits into
chenghan.ying/sq-request-reason-keepfrom
chenghan.ying/sq-request-failure-category
Open

roychying wants to merge 2 commits into
chenghan.ying/sq-request-reason-keepfrom
chenghan.ying/sq-request-failure-category

Conversation

@roychying

@roychying roychying commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Why?

A request that ends in error carries only a free-text reason. A hook that tells the author what to do next, such as a pull request comment, needs to know the kind of failure: rebase for a conflict, fix the build for a build failure, or just resubmit after an internal error. Parsing the reason text for that would be fragile.

What?

  • entity.FailureCategory: duplicate, validation_rejected, build_failed, land_failed, internal_error, or empty when unknown. A later PR in this stack adds merge_conflict.
  • Every path that ends a request in error records its category on the terminal log, under the failure_category metadata key:
    • validate: duplicate and validation_rejected;
    • speculate (no viable build passed): build_failed when a live path's build failed. When every live build was cancelled instead, for example by the CI provider, nothing showed the change broken, so it is internal_error with the reason "every viable build was cancelled";
    • land-conflict check and land signal (Runway's merge result): land_failed for any Runway merge failure, conflicts included, until the last PR in this stack splits conflicts out as merge_conflict. The land-conflict check's repair resend carries the category too;
    • the DLQ, when a stage gives up: internal_error.
  • Batch conclusion carries the category beside the reason on the conclude message (failure_category attribute), so a batch failure records the same category on each of its requests.
  • Known gap, noted on failBatch: if a batch already failed but its conclude has not run yet, a dead letter about that batch records internal_error on its members first, and the conclude that follows only resends. The batch's failure travels only on the conclude message, so the DLQ has nothing better to record.

Test Plan

  • bazel test //submitqueue/entity/... //submitqueue/orchestrator/....
  • make lint check-gazelle check-mocks
  • End to end, on an internal staging deployment whose comment hook reads these categories: a failed build ended as build_failed, a second submission of a pull request already in flight as duplicate, and a scorer error as internal_error.

Issue

@roychying
roychying added this pull request to stack #1111 December 1, 2026 16:52
@roychying
roychying force-pushed the chenghan.ying/sq-request-failure-category branch from 73662f0 to c5deca6 Compare December 1, 2026 17:56
@roychying
roychying force-pushed the chenghan.ying/sq-request-failure-category branch from c5deca6 to cd59a61 Compare December 1, 2026 18:25
@roychying
roychying marked this pull request as ready for review December 1, 2026 18:29
@roychying
roychying requested review from a team and sbalabanov as code owners December 1, 2026 18:29
@roychying
roychying force-pushed the chenghan.ying/sq-request-failure-category branch from cd59a61 to 9e1b5af Compare December 2, 2026 22:23
@roychying
roychying force-pushed the chenghan.ying/sq-request-failure-category branch from 9e1b5af to c0a9331 Compare December 2, 2026 22:55

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant