You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Summary
- New gateway `Cancel(sqid)` RPC that publishes a `CancelRequest` to
`TopicKeyCancel`; processing is asynchronous and cancellation is not
guaranteed (a request that has already merged, or that races to
completion, may still land or error — callers should check the actual
outcome via the separate status / request-log API).
- New orchestrator cancel controller with a two-step transition:
`RequestStateCancelling` (non-terminal intent) → either
`RequestStateCancelled` directly (un-batched) or via batch cancel +
conclude fan-out (batched). The Cancelling intent is non-terminal so
concurrent merge / failure may still win and prevail with `Landed` /
`Error`.
- Every stage controller (validate, batch, score, build, buildsignal,
merge, conclude, speculate) is now cancellation-aware via a single
`IsRequestStateHalted` / batch-terminal short-circuit. Speculate treats
cancelled deps as out-of-the-way (drop and continue) instead of
cascade-failing; conclude maps `BatchStateCancelled` →
`RequestStateCancelled`.
- Cancel controller does not classify storage errors itself —
`storage.ErrNotFound` and `storage.ErrVersionMismatch` propagate as-is
so the base controller layer can map them to retryable, matching the
pattern in every other orchestrator controller.
## Test plan
- [ ] `make fmt && make lint && make check-tidy && make check-gazelle &&
make check-mocks` clean
- [ ] `bazel test //... --test_tag_filters=-integration,-e2e` (32
unit-test targets) all pass
- [ ] Manual e2e via `make local-start`: Land → Cancel before batch →
confirm `RequestStateCancelled` and no batch created
- [ ] Manual e2e: Land → wait for batch → Cancel → confirm batch goes
`Cancelled`, contained requests reconcile to `Cancelled`, dependent
batches respeculate
- [ ] Integration test exercising both paths through real MySQL
extension
## Out of scope (deferred)
- Re-enqueuing non-cancelled requests from a cancelled batch (TODO in
cancel controller).
- Cancelling a real CI build via external API (no-op today; hook is the
existing `BuildStatusCancelled` write).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: sergeyb <sergeyb@uber.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: entity/request_log.go
+10Lines changed: 10 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -78,6 +78,16 @@ const (
78
78
79
79
// RequestStatusError indicates that the request has encountered an error. It corresponds to the RequestStateError state.
80
80
RequestStatusErrorRequestStatus="error"
81
+
82
+
// RequestStatusCancelling indicates that the user has requested cancellation but the request has not yet transitioned
83
+
// to the RequestStateCancelled state. Cancellation is best-effort: a request that has already been merged or that
84
+
// races to completion before the cancel propagates through the pipeline may still land. Observers should treat this
85
+
// as intent only and rely on RequestStatusCancelled (or RequestStatusLanded) for the terminal outcome. Emitted by
86
+
// the gateway when the Cancel RPC is received.
87
+
RequestStatusCancellingRequestStatus="cancelling"
88
+
89
+
// RequestStatusCancelled indicates that the request was cancelled by the user before it could land. It corresponds to the RequestStateCancelled state.
90
+
RequestStatusCancelledRequestStatus="cancelled"
81
91
)
82
92
83
93
// RequestLog is an append-only record that captures a point-in-time snapshot of a request's status
0 commit comments