fix(review): stop lease cancellation storms - #922
Merged
Conversation
This was referenced Jul 29, 2026
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
Stop the exact-review cancellation storm observed on 2026-07-28 by fixing both sides of the failure chain:
reviewtofinalizing. Review heartbeats retain the 20-minute crash detector; finalization retains the 130-minute execution fence and terminal-run reconciliation backstop.The repository-variable reverter incident is intentionally out of scope.
Incident attribution
All six sampled cancelled runs had a
Review exact event itemjob with zero executed steps. They were pending, not stalled in Codex or hydration. GitHub Actions permits one running and one pending job per concurrency group; a new same-item dispatch automatically cancels the old pending job even withcancel-in-progress: false.There is no exact-review cancellation API call in the queue or reconciler. The only repository workflow cancellation call is the unrelated state-materializer scheduled-run dedupe. The org audit log had no cancellation action matching these samples.
openclaw/openclaw#115308 lifecycle
The PR entered the durable queue as revision 2 and run 30381116855 claimed it at 17:03:23Z. The durable status comment was created at 17:04:44Z. Codex completed successfully at 17:06:32Z, the exact-review bundle completed at 17:06:34Z, and the run then stalled in
setup-statefrom 17:06:35Z onward.That step was still checking out the full generated-state tree before Worker hydration. The review heartbeat stopped when Codex completed, so the queue's effective lease became the last heartbeat plus 20 minutes instead of the 130-minute execution expiry. Around 17:26Z the Durable Object reclaimed the apparently stale lease and dispatched the first retry. The original GitHub job was still running, so each retry remained the single pending same-item job; every six-minute dispatch-lease recycle dispatched another copy and GitHub cancelled the prior pending copy. The PR head and review revision did not change during this loop.
The maintainer merged the PR at 18:28:03Z after posting the manual-landing explanation at 18:24:12Z. The queue's live-item probe subsequently removed the now-terminal item. The hydration source flip-flopping did not stall this run: it had already entered
setup-stateat 17:06Z, more than 30 minutes before those variable changes began.Reconciler findings
The reconciler observed terminal workflow results; it did not cancel healthy runs. In the incident window, 809 reconciler runs succeeded and three scheduled sweeps failed. All three failures happened later in
Recover orphaned review placeholdersbecause the placeholder backlog exceeded its alert threshold; terminal claimed-run reconciliation had already completed. Those failures did not cause the sampled cancellations.Changes
setup-statecheckout behavior:finalizinglease phase.The existing semantic edit dedupe from #857 remains intact. Unchanged retries in this incident were lease redispatches, not duplicate
pull_request.editedingress, so broadening that dedupe would not address the dominant cause.Proof
pnpm run check: green (format, all TypeScript builds, four lint lanes, full unit/coverage suite).openclaw/clawsweeper-state: repository reports roughly 42 GB; blobless no-checkout clone was 36 MB, the Worker projection checkout was 170 MB, and clone plus checkout completed in about 30 seconds./Users/steipete/.claude/skills/autoreview/scripts/autoreview --mode local: clean, no accepted/actionable findings.Risk
Explicit git hydration remains the deliberate full-projection rollback path. A finalizer that genuinely hangs now holds its lease until the 130-minute execution expiry or terminal workflow reconciliation instead of spawning duplicate reviews after 20 minutes; newer source revisions still fence it immediately.