Repository navigation
fix(launcher): A job GitHub can't read yet gets its runner once it can, not dropped - #61
Merged
Merged
Conversation
GitHub sends workflow_job queued before it can read the job: the launcher's first read got 404 for about 1 job in 30, took it as gone and dropped the message. Since ADR-0004 such a job can't take another job's runner, so it stayed queued until GitHub cancelled it. A 404 on a message that has had no launch now goes back on the queue as a new message, 10 s on, carrying unreadable_since, for up to 5 minutes from the first 404; then it is dropped, logged with never_readable_s. A 404 on a message that has had a launch is still dropped at once. Refs #60 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…h it had no launch Review round 1 of #60: a budget deferral, or a check of a job served by another delivery's runner, re-sent a job that had read queued with no launches, so a later 404 on it (a deleted run) was taken as "not readable yet" and tried for 5 minutes. Such messages now carry read: true. Tests also cover the 404 on the read after a swap, and a deferral leaving out unreadable_since. Refs #60 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sodre
marked this pull request as ready for review
November 25, 2026 02:16
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.
Closes #60
Summary
A job that GitHub can't read yet when its
queuedevent arrives now gets a runner once GitHub can read it, a few seconds later, instead of being dropped and left queued until GitHub cancels it 24 hours on.GitHub sends
workflow_jobqueuedbeforeGET /repos/{repo}/actions/jobs/{id}can read the job: on 2026-11-24 about 1 job in 30 read 404 for a second or two. The launcher took that 404 as "gone" and dropped the message. Before ADR-0004 such a job still took another job's runner; with the job label it never got one.Choices the ticket left open:
unreadable_since, the time of the first 404, as the ticket's Key interfaces suggest. The bound is 5 minutes from it, and each try is 10 s apart (UNREADABLE_BOUND_MS,UNREADABLE_RETRY_SECONDS), so a job that never reads costs at most 30 reads.read: true. The 404 on the read after a swap follows a read that just succeeded, so it drops at once too.docs/stack.md("Launching for queued jobs", step 3), the "Waiting for a runner" row ofdocs/traps.mdand the launcher's log table indocs/runbook.mddescribe the new lines and whatjob not foundmeans now.Evidence
queued: launched, check sent, nodroppedlinedocs/stack.mdand thedocs/traps.mdrow describe the new behaviour and thejob not foundlinedocs/stack.mdstep 3, thedocs/traps.mdrow and thedocs/runbook.mdtable in the diff and judged it metlaunchedfor the same joba job that reads 404 at first and queued later is launched, its check sent, and nothing dropped)the job is tried again: 0 !== 1. Withunreadable_sincekept on later messages: the check'sMessageBodycarried"unreadable_since":1794484800000a job read before that GitHub no longer has (404) is dropped at once; any other failure retries the message)retrying: 'job not readable yet'instead ofdropped: 'job not found'waiting on a job not readable yet is a new message, 10 s on, not a failed receive, …)a job that keeps reading 404 is tried until 5 minutes from its first 404, then dropped, logged as never readable)the bound runs from the first 404, across the messagesa job read and then deferred for budget is dropped at once if it then reads 404; the deferral leaves out unreadable_since)MessageBodyhad no"read":truea job whose runner is busy, read again after the swap and gone (404), is dropped at once)a Fargate job served by its own task is not launched again, and its check goes on)make test(node --test test/*.test.js): 209 passed, 0 skipped, 0 failed, on 2fee303.make build:build/template.yaml77,548 of 1,048,576 bytes.Live, per "Proving a change live": the branch at 2fee303 was deployed to
ci-runneron 2026-11-25 (change set:LauncherFunctionmodified in place, nothing else;UPDATE_COMPLETE01:14:26Z), and the launcher's log was followed for an hour, to 02:14:26Z. One job queued in that window, onci-fargate-spot: the webhook loggedenqueuedat 01:53:59.835Z, the launcher read itqueuedon its first try and loggedlaunched(a Fargate Spot task) at 01:54:07Z, and its check at 01:59:07Z loggeddropped: completed. No job read 404, so noretryingline occurred: with about 1 job in 30 hitting it on 2026-11-24, one job gave it little chance. The deployed launcher's launch, check and drop paths ran as before.Not run: a live
retryingfollowed bylaunchedfor the same job; no job read 404 during the hour's proof window (one job queued). The stack keeps running this branch, so the first such job will show it in the launcher's log.Merge Danger
Door: two-way. A revert restores the drop on a 404; messages in flight carrying
unreadable_sinceorreadare read by the old launcher as before, which ignores both fields.Blast Radius: the launcher.
The merge changes the launcher Lambda only: no image, no IAM, no queue setting. The stack is updated by
make deploy; this branch is already deployed toci-runner(2026-11-25 01:14:26Z, a change set modifying onlyLauncherFunctionin place). No feature flag.Reviews
Correctness, Standards, Spec and Security, two rounds: 11 findings, each with its outcome
Correctness, round 1 (pinned ab2cd1e, at
medium)queuedwith nolaunches, so a later 404 (a deleted run) is taken as "not readable yet". Fixed: a message re-sent with no launch after a read carriesread: true, and a 404 on it is dropped at once.launches, so a 404 on it waits out the bound. Pushed back: it needs a failed send and a deleted run inside the same 120 s, and costs at most 30 reads before the drop, the same outcome.docs/stack.md, "There is no de-duplication on job id beyond that check"); the launch path's machine listing stops a double launch.unreadable_since. Fixed: the deferral test asserts its message body.never_readable_srow would mislabel a deferred, deleted job. Fixed: by finding 1, a read job never reaches that row.Standards, round 1
msgandmname nearly the same message inhandle. Fixed: the message is destructured once at the top;mis the only name used.queuedlogs, and two sites logdropped: 'job not found'. Pushed back:queued's logging predates this change, and the second site differs bynever_readable_son purpose.Spec, round 1
Security, round 1: no findings. Correctness, Standards, Spec and Security, round 2 (pinned 2fee303, fix round, Correctness at
low): no findings.Tracking
Epic: none
Spec: none
Ticket: #60 ci-fargate-spot jobs left queued for hours with no runner while neighbours seconds apart were served
Flag: none
🤖 Generated with Claude Code