Skip to content

Replacement runner waits ~50s for the next listener patch after a job finishes on 0.15.0 #4704

Open

Description

@TekMath

Checks

Controller Version

0.15.0

Deployment Method

Helm

Checks

  • This isn't a question or user support case (For Q&A and community support, go to Discussions).
  • I've read the Changelog before submitting this issue and I'm sure it's not due to any recently-introduced backward-incompatible changes

To Reproduce

1. Install both charts at 0.15.0 with minRunners: 0 and maxRunners: 3 (dind template).
2. Run a workflow with more queued jobs than maxRunners (a matrix of 10+ jobs is enough).
3. Watch the pods: each time a runner finishes, its replacement is only created about 50 seconds later.

Describe the bug

Since we moved to 0.15.0, every time a runner finishes while other jobs are still queued, the
replacement pod takes close to a minute to show up. The pod itself starts in about 15 seconds,
so the time is lost before it gets created.

From the logs, the listener publishes the new desired count (3) one second before the
controller cleans up the finished runner. The controller then logs "Skipping scale up until
listener publishes a fresh desired state after finished runner cleanup" and nothing happens
until the listener's long poll times out and it publishes again, about 50 seconds later:

21:59:41 listener: Ephemeral runner set scaled, replicas=3 (patchID 127)
21:59:42 controller: runner pzrrr finished, deleted
21:59:42 controller: Skipping scale up until listener publishes a fresh desired state...
22:00:31 listener: Ephemeral runner set scaled, replicas=3 (patchID 128)
22:00:31 controller: Creating new ephemeral runner

This looks like a side effect of #4642. On a 28-job workflow with 3 runners it adds roughly
10 minutes of pure waiting. 0.14.2 does not have this delay.

Describe the expected behavior

When the desired count published by the listener already accounts for the queued jobs, the
replacement runner should be created right after the cleanup, not on the next long-poll
timeout. Or the listener could publish again as soon as a runner finishes.

Additional Context

githubConfigUrl: https://github.com/<org>
githubConfigSecret: <redacted>
runnerScaleSetName: kairo-arm64
minRunners: 0
maxRunners: 3
# template: the documented dind pod spec, plus resources and a daemon.json mount

# Kubernetes: k3s v1.34.5, arm64 workers

Controller Logs

https://gist.github.com/TekMath/af957d542c3cf73e5994b5bfcb5ee6ff#file-arc-controller-log

Runner Pod Logs

https://gist.github.com/TekMath/af957d542c3cf73e5994b5bfcb5ee6ff#file-arc-listener-log

Activity

  1. added
    bug
    needs triage
    gha-runner-scale-set
    on Oct 3, 2026
  2. github-actions commented on Oct 3, 2026

    @github-actions
    Contributor

    Hello! Thank you for filing an issue.

    The maintainers will triage your issue shortly.

    In the meantime, please take a look at the troubleshooting guide for bug reports.

    If this is a feature request, please review our contribution guidelines.

  3. bowd commented on Oct 9, 2026

    @bowd

    Seeing the same thing. Those delays can really compound.

  4. bowd commented on Oct 10, 2026

    @bowd
  5. transpiredprincess commented on Oct 16, 2026

    @transpiredprincess

    Same here on 0.15.0 (EKS, dind as a native sidecar, minRunners 0,
    maxRunners 3). It also hits a single job queued through needs: the
    moment the job it needs ends, not only matrices above maxRunners. There
    it's a race: of 17 such jobs, 7 waited 47–66 s and 10 waited 9–17 s,
    depending on whether the listener's patch lands before or after the
    finished runner turns Succeeded (~1 s apart). One occurrence, from a
    watch on the set, runners and pods:

    03:08:28.390  ERS spec replicas=1 patchID=1791
    03:08:28.838  ER phase=Succeeded (runner container exited 03:08:28)
    03:08:28.868  ERS status finishedRunnerCleanupPatchID=1791
    03:09:18.478  ERS spec patchID=1792 (empty long poll, +50.09 s)
    03:09:18.478  new EphemeralRunner created
    
  6. vrazdalovschi commented on Oct 23, 2026

    @vrazdalovschi

    Also seeing this on 0.15.0 (GKE 1.36, minRunners: 0, maxRunners: 9, scale-to-zero node pool). Across 21 suppression events in one day the median wait to the next scale-up was 44 s, matching the report above.

    We also hit a much worse case where the controller stayed in this state for 21 minutes while jobs were queued:

    19:05:54  controller: Finished ephemeral runners were cleaned up, deferring scaling decision
    19:05:54  controller: Skipping scale up until listener publishes a fresh desired state after finished runner cleanup  patchID=1308
    19:05–19:27  listener: ~40 EphemeralRunnerSet patches (patchID 1309 → 1349, replicas 2 → 7), all visible in the API server audit log
    19:05–19:27  controller: no log lines at all (no EphemeralRunnerSet or AutoscalingRunnerSet reconciles)
    19:27:13  controller: EphemeralRunnerSet and AutoscalingRunnerSet both reconcile in the same second, with no external write at that time
              Scaling comparison current=0 desired=7 → Creating new ephemeral runners (scale up) count=7
    

    We think the trigger was the controller missing watch events for about 20 minutes, not the patch-ID logic itself. Once the reconciler has returned from the suppression branch with no requeue, though, nothing brings it back:

    • the reconcile returns ctrl.Result{} without RequeueAfter;
    • WithEventFilter(predicate.ResourceVersionChangedPredicate{}) drops the periodic --sync-period resyncs, because their resourceVersion is unchanged.

    So any missed event from the listener turns into a stall that lasts until the informer relists. A bounded RequeueAfter in the suppression branch would cap the 50 s case and also limit how long a missed event can block scale-up. That requeue would need to read the spec from the API (via APIReader), not the cache, to help when the cache is stale.

  7. pablog12 commented on Oct 24, 2026

    @pablog12

    Additional measurements on ARC gha-runner-scale-set-controller and gha-runner-scale-set 0.15.1, Helm, single-node k3s v1.36.5+k3s1, about 13 scale sets and a current workload of ~195 jobs/hour. Both binaries use actions/scaleset v0.5.0 (Go 1.27.3). This is the same refill gap, still present in 0.15.1.

    Timing and logs

    Across approximately ten hours of retained controller logs:

    • 2,239 unique successful runner-process finishes; 2,034 matched a GitHub job completion. A successful process exit alone does not prove a job ran.
    • 1,811 finishes had positively observed queued jobs with matching labels. 620 independent 30–75 s cleanup-suppression intervals had confirmed backlog: 34.2% of backlog finishes.
    • For those long intervals, suppression → successful EphemeralRunner creation: median 49.259 s. Matched job completion → creation: median 51.217 s, p90 51.742 s. This wait occurs before scheduling/startup.
    • Another 94 long intervals had unknown demand and are excluded from the confirmed-backlog count. No long interval matched the 16 observed no-demand finishes.

    Exact controller message text, with resource metadata omitted:

    Finished ephemeral runners were cleaned up, deferring scaling decision
    Skipping scale up until listener publishes a fresh desired state after finished runner cleanup
    

    The latter carries the unchanged patchID. A successful create follows the next listener publication, usually one ~50 s long poll later.

    Intervals were deduplicated across repeated guard logs and matched to at most one preceding finish within 5 s, without reusing finishes. Queued-label demand proves waiting work, not reservation to one scale set; overlapping labels and incomplete job history remain limitations. At 195 finishes/hour, reducing the confirmed intervals to 5 s would recover 0.656 continuously available runner slots, or 0.756 if the unknown-demand intervals also needed replacements: roughly 0.7–0.8 slots. This is a capacity estimate, not a throughput promise or a measured fix result.

    Minimal reproduction

    1. Use the official 0.15.1 charts, minRunners: 0, maxRunners: 3, and a unique test label.
    2. Queue more short jobs than the maximum (for example, a matrix of 12 sleep 10 jobs). Watch ERS spec.replicas/spec.patchID, cleanup status and EphemeralRunner creation timestamps alongside listener/controller logs.
    3. Observe the ordering where the listener has already accounted for a completion and publishes the replacement demand just before the finished runner is cleaned up. The controller records that same patch ID as requiring a fresh snapshot, then suppresses scale-up until the next idle-poll publication.
    4. Compare job completion with EphemeralRunner creation, separately from pod scheduling and runner readiness. The ordering is a race, so repeat a few bursts.

    Expected: prompt replenishment when the desired-state snapshot demonstrably accounts for every cleaned-up completion, while preserving suppression for stale demand.

    Cause and proposed fix

    The 0.15.1 cleanup/scale-up guard introduced by #4642 cannot distinguish an already-accounted-for finish from stale desired demand. A controller requeue alone still sees the same patch ID. The missed-watch liveness problem described above is separate; bypassing the guard on a timer could recreate completed work.

    The completion acknowledgements in the previously linked prototype appear to supply the missing causal information: publish a bounded, deduplicated completion-name set atomically with replicas and patchID, and bypass cleanup suppression only when that exact snapshot acknowledges every finish in the batch. Missing/evicted acknowledgements must keep the conservative fallback; listener restarts must clear history. Same-patch replenishment also needs an authoritative capacity check to avoid stale-cache overcreation (see #4723), and deletion/cleanup updates must preserve the guard under conflicts.

    We validated this approach in a local prototype, including a stock-controller negative control, but have not deployed it. It adds an optional ERS field and therefore changes the CRD/API contract. Following CONTRIBUTING's request to discuss significant changes first, we would like maintainer agreement on the acknowledgement shape before opening a focused PR with the regression tests. We will stay on released upstream ARC and adopt an upstream fix when released.

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

    buggha-runner-scale-setneeds triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions