Skip to content

Self-hosted runner gets stuck in active state, blocking queued jobs across multiple repositories #4312

Closed

Description

@OcheOps

Summary

We experienced an issue where a self-hosted GitHub Actions runner remained in an active (busy) state indefinitely, preventing new jobs from being picked up. This impacted multiple repositories using the same runner infrastructure.

Impact
Affected 3 repositories sharing the same self-hosted runner host
Jobs remained in queued state for several hours (~3+ hours)
CI/CD pipelines (including SonarQube analysis) were blocked
Manual intervention (runner restart) was required to restore functionality
Observed Behavior
Runner appears as Active in GitHub UI

New jobs show:

Waiting for a runner to pick up this job...
Requested labels: self-hosted
No new jobs are picked up despite runner being online and connected
Runner logs show it is listening for jobs, but an existing worker process remains attached

System inspection shows a hanging process:

npm run test:co
└─ vitest run --coverage
Runner does not automatically recover or release the job
Expected Behavior
Runner should:
Detect and terminate stalled/hung jobs
Return to Idle state after job timeout or failure
Continue picking up queued jobs without manual restart
Temporary Resolution

Restarting the runner service resolves the issue:

sudo systemctl restart actions.runner...service

After restart:

Runner returns to Idle
Queued jobs are immediately picked up

Environment
Self-hosted runners on Linux (Ubuntu)
Multiple runners installed on same host (different repos)
Runner version: 2.333.0
Workloads include:
Node.js (Vitest tests with coverage)
SonarQube analysis
CI/CD pipelines

Suspected Cause
Long-running or hanging test process (vitest --coverage) does not exit cleanly
Runner does not enforce timeout or detect job inactivity
Worker process (Runner.Worker) remains attached indefinitely
No automatic cleanup or job termination

Suggested Improvements
Add automatic detection of stalled jobs (e.g., no output / no CPU activity threshold)
Enforce configurable job timeouts at runner level
Improve visibility in GitHub UI for:
currently running job duration
stuck/hung jobs
Allow runner to gracefully recover without requiring full service restart
Additional Notes
This issue affected multiple repositories sharing the same infrastructure, indicating it is not isolated to a single workflow
Adding workflow-level timeout-minutes mitigates the issue but does not fully solve runner-level hangs

Activity

  1. added
    bug
    on Mar 25, 2026
  2. MarkPorohnja commented on Apr 20, 2026

    @MarkPorohnja

    PR related to this issue was closed due to inability of fixing problems with runners in the current code base. This blocks us from rolling out Enterprise-grade solution for self-hosted runners.

    PR I am referencing to:
    actions/actions-runner-controller#4399

    comments:
    actions/actions-runner-controller#4399 (comment)
    actions/actions-runner-controller#4399 (comment)

    please pay more attention to this topic. This is very important.

    usually happens after OOM events. Github shows runner as registered but offline. Logs:

    Updating certificates in /etc/ssl/certs...
    rehash: warning: skipping ca-certificates.crt,it does not contain exactly one certificate or CRL
    rehash: warning: skipping ca.pem,it does not contain exactly one certificate or CRL
    1 added, 0 removed; done.
    Running hooks in /etc/ca-certificates/update.d...
    done.
    [RUNNER 2026-03-11 14:38:25Z INFO HostContext] No proxy settings were found based on environmental variables (http_proxy/https_proxy/HTTP_PROXY/HTTPS_PROXY)
    [RUNNER 2026-03-11 14:38:25Z INFO HostContext] Well known directory 'Bin': '/home/runner/bin'
    [RUNNER 2026-03-11 14:38:25Z INFO HostContext] Well known directory 'Root': '/home/runner'
    [RUNNER 2026-03-11 14:38:25Z INFO HostContext] Well known config file 'Credentials': '/home/runner/[redacted]'
    [RUNNER 2026-03-11 14:38:25Z INFO HostContext] Well known config file 'Runner': '/home/runner/[redacted]'
    [RUNNER 2026-03-11 14:38:25Z INFO HostContext] Adding extra user agent 'actions-runner-controller/0.12.1' to all HTTP requests.
    [RUNNER 2026-03-11 14:38:25Z INFO Listener] Runner is built for Linux (X64) - linux-x64.
    [RUNNER 2026-03-11 14:38:25Z INFO Listener] RuntimeInformation: Ubuntu 24.04.3 LTS.
    [RUNNER 2026-03-11 14:38:25Z INFO Listener] Version: 2.331.0
    [RUNNER 2026-03-11 14:38:25Z INFO CommandSettings] Env arg 'jitconfig': '***'
    [RUNNER 2026-03-11 14:38:25Z INFO Runner] RunAsync
    [RUNNER 2026-03-11 14:38:25Z INFO Runner] Falling back to original .runner settings
    [RUNNER 2026-03-11 14:38:25Z INFO Runner] Using BrokerMessageListener
    [RUNNER 2026-03-11 14:38:25Z INFO BrokerMessageListener] Using provided settings
    [RUNNER 2026-03-11 14:38:25Z INFO BrokerMessageListener] {
    [RUNNER 2026-03-11 14:38:25Z INFO BrokerMessageListener]   "AgentId": [redacted],
    [RUNNER 2026-03-11 14:38:25Z INFO BrokerMessageListener]   "AgentName": "[redacted]",
    [RUNNER 2026-03-11 14:38:25Z INFO BrokerMessageListener]   "PoolId": [redacted],
    [RUNNER 2026-03-11 14:38:25Z INFO BrokerMessageListener]   "DisableUpdate": true,
    [RUNNER 2026-03-11 14:38:25Z INFO BrokerMessageListener]   "Ephemeral": true,
    [RUNNER 2026-03-11 14:38:25Z INFO BrokerMessageListener]   "ServerUrl": "[redacted]",
    [RUNNER 2026-03-11 14:38:25Z INFO BrokerMessageListener]   "WorkFolder": "_work",
    [RUNNER 2026-03-11 14:38:25Z INFO BrokerMessageListener]   "UseV2Flow": true,
    [RUNNER 2026-03-11 14:38:25Z INFO BrokerMessageListener]   "ServerUrlV2": "https://broker.actions.githubusercontent.com/"
    [RUNNER 2026-03-11 14:38:25Z INFO BrokerMessageListener] }
    [RUNNER 2026-03-11 14:38:26Z INFO BrokerMessageListener] Attempt to create session.
    [RUNNER 2026-03-11 14:38:26Z INFO BrokerMessageListener] Connecting to the Broker Server...
    [RUNNER 2026-03-11 14:38:26Z INFO BrokerMessageListener] VssConnection created
    [RUNNER 2026-03-11 14:38:26Z INFO BrokerMessageListener] Connecting to the Runner server...
    [RUNNER 2026-03-11 14:38:27Z INFO Terminal] WRITE LINE:
    
    √ Connected to GitHub
    [RUNNER 2026-03-11 14:38:28Z ERR  GitHubActionsService] POST request to https://broker.actions.githubusercontent.com/session failed. HTTP Status: Conflict
    [RUNNER 2026-03-11 14:38:28Z ERR  BrokerMessageListener] Catch exception during create session.
    [RUNNER 2026-03-11 14:38:28Z ERR  BrokerMessageListener] GitHub.DistributedTask.WebApi.TaskAgentSessionConflictException: Error: Conflict
    [RUNNER 2026-03-11 14:38:28Z INFO BrokerMessageListener] The session for this runner already exists.
    [RUNNER 2026-03-11 14:38:28Z ERR  Terminal] WRITE ERROR: A session for this runner already exists.
    A session for this runner already exists.
    [RUNNER 2026-03-11 14:38:28Z ERR  Terminal] WRITE ERROR: 2026-03-11 14:38:28Z: Runner connect error: Error: Conflict. Retrying until reconnected.
    2026-03-11 14:38:28Z: Runner connect error: Error: Conflict. Retrying until reconnected.
    [RUNNER 2026-03-11 14:38:28Z INFO BrokerMessageListener] Sleeping for 30 seconds before retrying.
    ...
    [RUNNER 2026-03-11 14:41:08Z INFO Terminal] WRITE LINE:
    
    √ Connected to GitHub
    [RUNNER 2026-03-11 14:41:09Z INFO BrokerMessageListener] Session created.
    [RUNNER 2026-03-11 14:41:09Z INFO Terminal] WRITE LINE: 2026-03-11 14:41:09Z: Runner reconnected.
    2026-03-11 14:41:09Z: Runner reconnected.
    [RUNNER 2026-03-11 14:41:09Z INFO Terminal] WRITE LINE: Current runner version: '2.331.0'
    Current runner version: '2.331.0'
    [RUNNER 2026-03-11 14:41:09Z INFO Terminal] WRITE LINE: 2026-03-11 14:41:09Z: Listening for Jobs
    2026-03-11 14:41:09Z: Listening for Jobs
    [RUNNER 2026-03-11 14:41:09Z INFO JobDispatcher] Set runner/worker IPC timeout to 30 seconds.
    
  3. rr-krupesh-savaliya commented on May 6, 2026

    @rr-krupesh-savaliya

    +1

  4. beanscg commented on Jun 10, 2026

    @beanscg

    Bean Labs took a public-source pass on this issue.

    The narrowest useful next step looks like: Offer to build a minimal repro or fixture around Node.js and report the exact observed behavior.

    Public evidence checked:

    • Open public issue in actions/runner; repo license MIT; no assignee; 3 comments.
    • Labels: bug.
    • Referenced files/paths: Node.js.

    A good acceptance check would be a narrow public change that directly exercises the issue's reported boundary.

    No PR opened from this pass.

  5. brtkwr commented on Jul 23, 2026

    @brtkwr

    +1, and a data point that v2.336.0 does not fix this (relevant since it shipped "Exit ephemeral runners on broker acknowledge job-not-found" and "Wait for worker to finish during cancel", which looked like they should cover it).

    Setup: ARC gha-runner-scale-set 0.12.0 on GKE, dind mode, runner image built from actions/runner v2.336.0 (rolled out ~6h before the incident).

    Timeline (2026-07-22, UTC):

    • 11:24 a workflow job starts on an ephemeral runner
    • 11:29 the workflow run is cancelled (fail-fast from a matrix job failure)
    • 11:33:58 the runner receives the cancellation: Job cancellation request <id> received, cancellation timeout 5 minutes.
    • From then on the runner logs that exact same line several times per second, indefinitely. It never completes the cancellation, never exits, and GitHub deregisters it server side after the timeout
    • Result: pod Running 2/2 in k8s, runner absent from GitHub. Scale set stats showed totalAssignedJobs: 1, totalRegisteredRunners: 0, and the listener counted the zombie towards its target, so the next queued job sat waiting ~25 minutes until we manually deleted the EphemeralRunner

    The job that was cancelled runs containers via the dind sidecar, consistent with the theory that the runner blocks forever waiting for a wedged worker/child during cancellation.

    Since actions-runner-controller#4399 (controller-side reaping) was closed with "the runner should exit", this hang is squarely on the runner binary. Happy to provide fuller logs.

    Our interim mitigation, for anyone else hitting this: activeDeadlineSeconds: 21600 on the runner pod template (6h, matching the default job timeout-minutes, so it can never kill a legitimate job) so the kubelet eventually reaps zombies and ARC replaces them.

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions