Repository navigation
Description
Describe the bug
We run a pool of ephemeral self-hosted runners (AWS Lambda–orchestrated autoscaling,
terraform-aws-github-runner module). Intermittently — heavily clustered around
cancel/re-run churn, but also on clean re-runs of previously-affected runs — a runner
claims a job, GitHub marks the runner busy, the runner executes the job to
completion (up to ~19 minutes observed: lease renewals and results-service log
uploads all succeed in our infrastructure logs), then the runner exits and
self-terminates per the ephemeral lifecycle.
Meanwhile GitHub's job record stays queued with zero steps, indefinitely
(observed 9+ hours). The run never progresses; downstream jobs that needs: the
stuck job are silently skipped, so CI-gated deploys never fire. No error is surfaced
anywhere — this fails silently.
Evidence (timestamps from our AWS Lambda scale-down logs, cross-referenced with the GitHub API)
07:36:32 UTC scale-up lambda: instance i-0c87688d572e957ef created (on-demand fallback after spot fleet failure)
07:38–07:40 runner registers; `GET /repos/{owner}/{repo}/actions/runners` shows total_count: 0 ← runner invisible via API
07:41:33 UTC scale-down lambda: "Runner 'i-0c87688d572e957ef' - GitHub Runner ID '205' - Busy: true"
07:41–07:44 scale-down polls: "cannot be de-registered, because it is still busy" (runner executing)
07:47:54 UTC instance terminated after going non-busy (normal ephemeral teardown)
During the exact same window, the job's API record:
status: "queued", conclusion: null, no steps, runnerName: null
Hours later (16:0x UTC): still status: "queued". Run never progressed.
So during execution GitHub's own runner inventory said Runner 205 was busy running
this job, while the job record said queued — the two views are inconsistent within
GitHub's service. After the runner's session ended, the lease was never released; a
re-run of the same workflow run gets claimed and executed again by a fresh runner and
stuck again the same way (observed twice today on the same run).
Runner / environment
- actions/runner 2.338.2, linux-arm64, ephemeral (
--ephemeral) - Reproduced with both JIT-config (
--jitconfig) and classic registration-token flows - Reproduced on spot and on-demand instances (rules out instance lifecycle)
- Runner binary distributed at boot from an account-local S3 syncer (latest release — 2.338.2 is current)
- Orchestration: terraform-aws-github-runner v8.1.1 (webhook → SQS → scale-up Lambda), GitHub App auth
- ~2.338.0→2.338.2 changed broker-session handling (Include owned session ID when deleting broker sessions #4743 "Include owned session ID when
deleting broker sessions", Implement broker-listener WebSocket connectivity probes. #4753 "broker-listener WebSocket connectivity probes") — noting
in case it's related, not alleging
What we ruled out
- Capacity/autoscaling: scale-up, SQS dispatch, registration, and assignment all work; the failure happens after a runner is busy with the job
- Instance lifecycle: spot preemption would not produce a runner that stays busy 10+ minutes executing lease renewals and log uploads successfully
- Registration mode: JIT and classic both affected
- A related run DID complete and report normally the same day on the same pool (and the pool ran our full CI suite green twice the day before) — so the handshake can work; the failure is intermittent (roughly a third of runs today, clustered around cancel/re-run churn)
- Cancel + re-run releases the lease (job returns to dispatchable state) — this is our only recovery path
Related issues (full sweep performed — screened by symptom and root cause)
Closest two (referenced as kin, not duplicates — see below):
- Runner.Worker hangs before reading the job message (30s IPC timeout), ignores SIGINT/SIGTERM; ephemeral runner exits 0 and the assigned job is orphaned in queued #4598 — worker hangs before starting the job; ephemeral runner exits 0, job orphaned in
queued. Same consequence (orphaned lease, cancel+rerun the only recovery, same proposed reconciliation), but in that report the job never executes. In ours the job demonstrably runs to completion; the loss is in job-state persistence during/after execution. - Ephemeral/JIT runner reports "lost communication" despite successful job completion — no grace period before broker disconnect #4309 — broker disconnect races completion reporting; UI stuck
queued/in_progressfor 10–30 minutes then eventually updates (or surfaces "lost communication"). Same fragile area (post-execution broker/session teardown — Include owned session ID when deleting broker sessions #4743/Implement broker-listener WebSocket connectivity probes. #4753 land in 2.338.x). In ours nothing ever surfaces: the job staysqueuedwith no steps indefinitely, silently blockingneeds:-gated downstream jobs.
Same area, screened and ruled different:
- Non-ephemeral runner cancels a running job to accept a second assignment; the job is lost and reported as cancelled with all steps skipped #4670 — non-ephemeral runner cancels a running job to accept a second assignment; the job is reported as cancelled (visible failure, different mechanism)
- Persistent runner drops the next job when it aborts its Busy long-poll at job completion ("was not acquired by Runner") #4728 — persistent runner drops the next job when aborting its Busy long-poll (persistent runner, next-job drop, not the assigned job's record)
- Listener stops polling broker after first job's Busy→Online transition (2.334.0, Windows, V2 flow) #4444 (closed) — listener stops polling broker after Busy→Online (2.334.0, Windows, V2 flow) — closed; different failure point
- Self-hosted runner (macOS/ARM64): Runner.Worker deadlocks at job startup right after creating the results WebSocket (ingest.sock), holding the runner busy #4558 — worker deadlocks at startup, job never executes (ours executes fully)
- Runner hangs in job cancellation redelivery loop on v2.336.0 and never exits (#4312 not fully fixed) #4569 — hang in job-cancellation redelivery loop
- Worker logs showing same jobId for different workflows/jobs and it's causing the registration of the runner to fail and the job to become orphaned #3621 — duplicate jobId in worker logs breaks runner registration
- Self-Hosted Runner does not pick up queued jobs #3478 / Self-hosted runner stuck on "Waiting for a runner to pick up this job..." in multi-step jobs #3609 — runner never picks up the queued job (no claim happens; in ours the claim, assignment, and busy-marking all occur)
- Self-hosted runner gets stuck in active state, blocking queued jobs across multiple repositories #4312 (closed), self-hosted runner on odroid xu4 doesn't always start the job #1168, v2.336.0 on macOS (arm64): Runner.Worker deadlocks in Process.Start — forked child never execs, spins at 100% CPU; every job hangs seconds after start #4570 — stuck-active / hung-worker variants
What distinguishes this report from all of the above:
- Side-by-side evidence: GitHub's own runner inventory reported
Runner ID 205 — Busy: true(captured in our autoscaler's logs) at the exact moment the job record saidqueued, no steps,runnerName: null— a service-internal inconsistency documented in real time - Proof of full execution: lease renewals and results-service log uploads succeeded for minutes
- Re-orphaning: a clean re-run of an affected workflow run gets claimed, executed, and orphaned again (observed twice on the same run)
- Reproduced across JIT and classic registration, spot and on-demand — ruling out the mechanisms proposed in the existing reports
Expected behavior
A job that a runner has claimed and executed should never remain queued with no
steps after the runner's session ends. If the runner's completion report is lost, the
service should reconcile the lease (re-queue or fail the job) once the runner session
is gone — and critically, surface an error rather than silently blocking
needs:-gated downstream jobs forever.
Who is affected / impact
Every CI-gated deploy in our two repos silently skips when this hits. Recovery is
manual (cancel + re-run). Because the job record shows queued, our monitoring sees
"CI in progress" rather than an incident.
Authorship note: this report was drafted with the assistance of an AI coding
agent working from diagnostics collected by our runner-pool infrastructure (Lambda
logs, GitHub API responses); the operator of the affected systems reviewed and
approved its content and the reproduction evidence. All timestamps and
log excerpts are from real events. Happy to provide further diagnostic data on
request.
Activity