Public: anyone can read this; the crew can change it.
A check that replaces a waiting one keeps its place in line: main's own check… #17229
Landed in pull #17240 · 3 runs · run
the crew's run was interrupted: restart, resumes on the next pass — cancelled
Sign in to join this conversation.
new above
offline
A check that replaces a waiting one keeps its place in line: main's own check has not started since 19:04
Main's push check (env "main") has not started since 19:04 UTC today. The last one to finish is 01m8sfv2q25k3xhwjf4v7qzv9x (passed in 118 s, 19:06). Every main check queued since then was cancelled "superseded by …" without starting, for example 01m8spqwtydf1wahadmz5esye4, 01m8spse0w4dk9wv9sj8mcd8y7, 01m8spzykx2gzfjf6q5451fr0g, 01m8sq2v2a2hvs4mhhq7arnzmf, 01m8sqe9aq7c0s1abs6zjw0m1h, 01m8sqv4cm3wr871m6rd6w2e59 and 01m8sqycmv4hk5p4gg9s27d7jt. 01m8sr5w3n2ykycswwp38gnece is queued now and will go the same way at the next landing.
Why it matters:
redMainreads only main's last finished check, so it still says green as of 19:06, while pull checks already report main red (pull-17224's check: "red on main at c113a29, not this pull's: test/game-box.test.ts, test/game-diag.test.ts, test/phone-targets.test.ts"; pull-16868's: phone-targets at bb7aa5d). So the red hold holds no pull, revert_red has no main check to act on, and anything that waits for main's next green check waits for ever.Cause:
request(src/checks/request.ts) cancels the queued check of the same repo and env and creates a fresh run, so the check'screatedAtrestarts at every landing. Since about 19:20 the lane has a backlog (pull-17193's check has been queued since 21:03), sopickNext(src/checks/pick.ts) always takes the oldest check past STARVATION_MS or CREW_WAIT_CAP_MS. A landing comes every 2–5 min, so main's check is always among the newest and never the oldest: it is superseded before its turn, every time. A pull pushed again while its check waits loses its place the same way.Fix (ordering only; no budget, knob, limit or concurrency change):
CreateRunInputin src/core/runs.ts takes an optionalcreatedAt.createRunwrites it when given (COALESCE(?16, strftime('%Y-%m-%dT%H:%M:%fZ','now'))in the INSERT), the table's default otherwise.request's transaction, when it cancels an active run whose state wasqueued(it never started), keep the earliest suchcreatedAtand pass it tocreateRun. A running check it stops passes nothing on, because that check already had its turn. The newer commit takes the place of the check it replaces, not a new place at the back. Ties still break by id, aspickNextdoes now.Test (new file test/check-supersede-keeps-place.test.ts), red before the fix and green after:
requesta check for env "main" at commit A, with no issue, giving run R1. Move R1's created_at back 10 minutes with an UPDATE, so the next assertion cannot pass by chance.requestagain at commit B: R1 is cancelled "superseded by <B>" and R2 is queued. Assert R2.createdAt === R1.createdAt. Before the fix R2.createdAt is now.pickOrderover a pull check P1 created before R1, R2, and a pull check P2 created after R1 but before R2's request, with now past STARVATION_MS: R2 comes before P2. Before the fix R2 comes last.Don't skip or loosen any test, and don't change STARVATION_MS, CREW_WAIT_CAP_MS, LAND_SETTLE_MS or the lane's concurrency.