630. A merge-queue ejection is caught before the queue, and recovered after it
Raised 2026-10-03 (UTC) by calef, after #1473 (the x86_64 paint path) was ejected from the merge queue at 01:45 UTC. The number is provisional until the merge queue lands it; the title and slug are drafts, and every new name below is provisional.
Why
swish-check makes every merge-queue attempt cost 20 to 38 minutes, so each ejection is expensive.
#1473's cause was script/roadmap --check's "IN-PROGRESS branch that already merged" check, which
can only fail inside a merge group, because only there does the branch's merge commit exist. The
ejection also cancelled auto-merge silently, which is the sixth class in
notes/coes/2026-09-30-lane-follow-through.md, whose mechanism 5 commissioned the recovery half.
Built
Each piece is described, with its measurements and its falsification, in
notes/queue-ejection.md.
- Caught at ready time.
script/roadmap --ready-branch BRANCHreads frontmatter only and fails when a block still reads IN-PROGRESS on BRANCH, naming the block and the fix.script/roadmap --selftestproves it against seven fixtures underscript/lint..github/workflows/ready-status.ymlruns it onpull_requestandmerge_group, and a draft passes. Falsified live on #1491: green as a draft, red 11 seconds aftergh pr ready, green again aftergh pr ready --undo. It was closed and its branch deleted. - The pre-push hook runs all of lint. Measured warm, three runs each,
script/lint --clippytook a median 27.4 s andscript/lint56.5 s. No check after clippy is over 3.5 s, so the hook runs the whole thing in place of--clippyand three hand-picked gates. It also runs--ready-branchwhen the pushed branch's pull request is ready. Its first full run found that a hook inherits GIT_DIR, which let a selftest write into the shared.git/config; the hook and the selftest now clear it. - Recovered after.
helpers/merge-drain.shreads each open pull request's last queue removal and enqueue, andhelpers/queue-ejected.jqdecides, with fixtures underscript/lint. One comment per ejection names the reason and the group's unsuccessful runs. A head whose group run failed or timed out is labeledqueue-ejectedand not re-armed. A cancelled group is re-armed at the same head, because 13 of the 18failed_checksejections so far were cancellations. The label comes off when the head moves, and the drain re-arms it unless it carriesneeds-architect.
BUGS
ready statusis not a required check, so a pull request armed by hand passes it by. The drain will not arm one with a failing check, which covers the normal path. Requiring it is calef's.- Creating the
queue-ejectedlabel the first time may need Issues write, whichnife-smelterlacks. The drain then saysSTALLED, comments that it could not hold, and re-arms as it did before. Nothing here has run as the bot yet: the drain runs only frommain. --ready-branchmatches by branch name. A block naming the wrong branch passes it and still fails in the group.
2026-10-03 (UTC), later: item 2 above no longer holds. The hook ran all of lint for under a day.
It cost 70 to 202 s under load. It now runs script/lint --no-cargo and skips a push that changes
no files (milestone 729 (the pre-push hook runs what fits in seconds)).
Follow-on
- Recorded. Making
ready statusa required check and pre-creating the label are the two asks, written where a reader meets them: the BUGS ofnotes/queue-ejection.mdand of.github/workflows/ready-status.yml.
Index row
A ready pull request whose own block still reads IN-PROGRESS fails in seconds on pull_request,
not 20 to 38 minutes into a merge group. The pre-push hook runs all of script/lint. The merge
drain says why a pull request was ejected, holds a head whose group failed, and re-arms it when
the head moves.