Skip to content

Ephemeral self-hosted runner executes a job to completion while GitHub's job record stays "queued" with no steps — lease never released, CI-gated workflows silently skip #4877

Open

Description

@g0rr0g

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):

Same area, screened and ruled different:

What distinguishes this report from all of the above:

  1. 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 said queued, no steps, runnerName: null — a service-internal inconsistency documented in real time
  2. Proof of full execution: lease renewals and results-service log uploads succeeded for minutes
  3. Re-orphaning: a clean re-run of an affected workflow run gets claimed, executed, and orphaned again (observed twice on the same run)
  4. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions