Skip to content

fix(submitqueue): Keep a finished request's reason when its terminal log is resent - #1154

Open
roychying wants to merge 2 commits into
chenghan.ying/sq-gateway-hook-publishingfrom
chenghan.ying/sq-request-reason-keep
Open

roychying wants to merge 2 commits into
chenghan.ying/sq-gateway-hook-publishingfrom
chenghan.ying/sq-request-reason-keep

Conversation

@roychying

@roychying roychying commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Why?

When the orchestrator repairs a request already in a terminal state, it resends the terminal log with a placeholder reason: "terminal status resent for consistency; original details may not have been retained". The gateway's materializer treated that resend like any other log at the same version, so it could overwrite the real reason, for example "no speculation path could pass", in the summary and in the request.failed hook event built from it.

What?

  • Orchestrator: a same-state repair marks the log with resent=true metadata and sends the reason and metadata its caller knows, instead of a placeholder that reads like a real reason. When the original log was never published, the resend is the only account of the finish, so it must say why:
    • TerminateRequest resends its caller's details;
    • the land-conflict check resends the redelivered result's reason;
    • cancel resends the cancel reason;
    • validation can't tell why it rejected the request, so it resends none.
  • Gateway materializer: a log that restates the summary's finished status and request version only fills in details the summary lacks. It never replaces a stored reason or metadata. This holds whichever copy arrives first, so a resend that overtakes the original still ends with the original's details. The resent marker stays on the log in History but never reaches the summary.
  • Docs: the gateway README says a finished status keeps the details it was first recorded with.

Test Plan

  • bazel test //submitqueue/gateway/core/request/... //submitqueue/orchestrator/....
  • make lint check-gazelle check-mocks

Issue

@roychying
roychying added this pull request to stack #1111 December 1, 2026 16:51
@roychying roychying changed the title fix(submitqueue): Keep a finished request's reason when its terminal … fix(submitqueue): Keep a finished request's reason when its terminal log is resent Dec 1, 2026
@roychying
roychying marked this pull request as ready for review December 1, 2026 17:15
@roychying
roychying requested review from a team and sbalabanov as code owners December 1, 2026 17:15
@roychying
roychying force-pushed the chenghan.ying/sq-request-reason-keep branch from 00593b9 to 207eddd Compare December 1, 2026 17:56
@roychying
roychying force-pushed the chenghan.ying/sq-request-reason-keep branch from 207eddd to e2076f7 Compare December 2, 2026 22:23
@roychying
roychying force-pushed the chenghan.ying/sq-request-reason-keep branch from e2076f7 to 265830c 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