Skip to content

fix(runner): find the thread limit that stops git add -A in the runner #8054

Done

Description

@devops-cli-service

Split from #8036.

ProblemThe implement Job of #7986 stopped at group 1 with git add -A failed ... unable to create threaded lstat: Resource temporarily unavailable. The host refused a new thread to git. The change in #8036 gives this stop the class ci_infra. The runner still refuses the thread, so git add -A does not run there.## Why this part is deferredThe cause of the limit lives in the runner host or in its manifest, not in the stop classifier. The work needs the cluster and a live proof. #8036 changes the classifier alone and can reach Ready.## Acceptance criteria- The cause of the thread limit in the runner Job is found. A comment on this issue names it.- The implement Job of a test item runs git add -A in the runner. The stop unable to create threaded lstat does not appear.- A check fails when the thread limit comes back.

Proposed design

Problem statement

Two implement Jobs stopped when the process table of the pod filled. The agent container of each Job reached 4095 tasks of the podPidsLimit of 4096, and those tasks are zombies. The runner image starts devops as PID 1 (Dockerfile:149). It reaps only its own children, so each orphan of an agent command stays a zombie until the pod ends. The pod then refuses a new thread, and git add -A stops with unable to create threaded lstat: Resource temporarily unavailable. The change installs tini in the runner stage of Dockerfile and starts devops under it as PID 1, and it adds a runner image smoke check that fails when the image starts no init.

Acceptance criteria

Requirement: Runner image init

The runner image MUST start the devops process under tini as PID 1, so each container of the runner Job reaps its orphaned child processes.

Scenario: Runner image smoke check

  • WHEN the runner case of .github/actions/image-smoke/action.yml runs against the built runner image in the image job of .github/workflows/ci.yml
  • THEN the check prints the image entrypoint tini -- devops and exits 0.

Requirement: Init check verdict

The image smoke check MUST decide its verdict in a pure function that a test can drive offline.

Scenario: Image that starts no init

  • WHEN a test calls the verdict function with the entrypoint of an image that runs devops directly
  • THEN the function returns a failure that names the missing init process.

Requirement: Runner Dockerfile

The runner stage of Dockerfile MUST install tini and MUST set ENTRYPOINT ["tini", "--", "devops"].

Scenario: Dockerfile lint

  • WHEN uv run devops ci --check --only hadolint runs after the change to Dockerfile
  • THEN hadolint exits 0 and reports no warning or error for Dockerfile.

Requirement: Smoke action static check

The edited image smoke action MUST pass its static checks.

Scenario: The action passes actionlint and zizmor

  • WHEN uv run devops ci --check --only actionlint,zizmor runs on the branch
  • THEN the command exits 0 and reports no finding for .github/actions/image-smoke/action.yml.

Requirement: Pending a person after the merge

The implement Job of a test item MUST run git add -A with no unable to create threaded lstat stop after the runner image rolls out.

Scenario: Post-rollout implement run

  • WHEN a person runs a test item through the implement Job after the release of the image with the init
  • THEN the Job log holds no unable to create threaded lstat and no /bin/sh: Cannot fork, and the git add -A step succeeds.

Existing Tool Considered

No alternatives check has run for this item. The open, maintained tool that covers the need is tini (https://github.com/krallin/tini), the small init that docker run --init starts. As PID 1 it reaps each orphaned child, so the process table of the pod does not fill with zombies. tini does not install itself, it does not set the image entrypoint, and it does not reap a child that devops starts and never waits for. The change adds the tini package to the runner stage of Dockerfile and sets ENTRYPOINT ["tini", "--", "devops"] there. The plan builds no reaper of its own, so it writes no build cost for one. The only new check code is one entrypoint verdict function and the runner case of the image smoke action, and it costs one image build and one container run in CI.

Key questions

  • What causes the unable to create threaded lstat stop in the runner Job?: The process table of the pod fills with zombie processes. The agent container of two implement Jobs reached 4095 tasks of the podPidsLimit of 4096, and those Jobs are fix(roadmap): plan files keep the cost mark and line estimates #5217 and fix(roadmap): a spent verification failure is not ci_infra #7986; the other implement Jobs of the same 12 hours peaked at 141 tasks or less. On the node, node_processes_state{state="Z"} rose from 16 to 4078 and fell to 3 when the pod ended. The limit counts each thread of the pod. The runner image starts devops as PID 1 (Dockerfile:149), and it reaps only its own children, so each orphan of a command of the agent stays a zombie until the pod ends. The pod then refuses the new thread that git asks for, and git stops with unable to create threaded lstat: Resource temporarily unavailable. [sources: docs/guidelines/kubernetes.md:129]
  • Which init reaps the orphaned children of PID 1?: Start devops under tini as PID 1, with ENTRYPOINT ["tini", "--", "devops"] in the runner stage of the image Dockerfile. (proposed)
    • Chosen: tini as PID 1. It is the init of docker run --init, it is open and maintained, and it reaps each orphan of PID 1.
    • Rejected: dumb-init. It reaps orphans too, but the owner names tini and tini is the init of docker run --init.
    • Rejected: Python SIGCHLD handler in devops. A SIGCHLD disposition of SIG_IGN breaks subprocess.wait, and a handler of devops reaps no child that is not its own.
    • Rejected: Higher podPidsLimit. It is the owner's host setting, and the tasks stay zombies, so it only delays the exhaustion.
  • Does the owner raise the runner host's process limit?: No. The owner raises no limit now. The measured tasks are zombies, so a higher podPidsLimit does not remove the cause; the guideline sets the limit from the peak thread count of each node, and the owner sets it in dan-petty/homelab. The change reaps the orphans first. The owner raises the kubelet podPidsLimit only if the stop returns with the init in place. (best practice) [sources: docs/guidelines/kubernetes.md:120]
    • Chosen: Leave podPidsLimit to the owner. The measured cause is a zombie leak, and the limit is a host setting of the cluster.
    • Rejected: Raise podPidsLimit. It is the owner's host setting and it only delays the exhaustion of the process table.
  • Does the Git setting index.threads=1 remove the stop?: No. The tasks of the pod are zombies, so the pod refuses the thread that git asks for while its process table is full. A git thread setting changes no task count. The change sets no git thread setting. (best practice) [sources: docs/guidelines/kubernetes.md:129]
    • Chosen: No Git thread setting. The measured cause is the zombie leak, and a thread setting changes no task count.
    • Rejected: index.threads=1. It limits the index threads of git only, and the tasks are zombies of the agent commands.
    • Rejected: core.preloadIndex=false. It turns index preloading off for every git command and removes no zombie.
  • Where does the image set the init?: In the runner stage of the image Dockerfile: install the tini package and set ENTRYPOINT ["tini", "--", "devops"] at the line that holds ENTRYPOINT ["devops"] today. One entrypoint covers the prepare, agent and publish containers of the runner Job. The CronJob sets only args (k8s/devops/cronjob-runner.yaml:61), and the admission policy refuses command in a Job of the Service (k8s/devops/roadmap-service/admissionpolicy.yaml:297), so no container bypasses the entrypoint. (best practice) [sources: k8s/devops/cronjob-runner.yaml:61, k8s/devops/roadmap-service/admissionpolicy.yaml:297]
    • Chosen: Image Dockerfile entrypoint. One line covers every container of the runner Job and the admission policy keeps command out of the Job.
    • Rejected: Job container command. It repeats for each container, and the admission policy of the Service refuses it.
    • Rejected: A wrapper around each agent command. The agent starts many commands, and a wrapper misses one.
  • Where do the smoke check and its offline-testable verdict live?: In the runner case of .github/actions/image-smoke/action.yml, with the verdict in a pure function in src/devops_cli/roadmap/runner_tools.py, the module that the runner image smoke already runs on the built image. (best practice) [sources: .github/actions/image-smoke/action.yml:53, src/devops_cli/roadmap/runner_tools.py:49]
    • Chosen: Image smoke action plus a verdict function in runner_tools.py. The action already runs on the built runner image, and the module is the home of the image checks.
    • Rejected: A new devops k8s live command. It needs the cluster and a live run, and the smoke check catches a lost init at build time.
    • Rejected: A shell comparison in the action only. No test can drive the verdict offline.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/bug
    source/agent
    status/new
    effort/medium
    value/high
    on Dec 1, 2026
  2. devops-cli-service commented on Dec 1, 2026

    @devops-cli-service
    ContributorAuthor
    • Scope: none. The title has the scope runner, and .github/labels.yml declares no scope/runner label. Add the label to the file to give the scope to this item.
    • Priority: The implement Job stops with git add -A failed, which is a CI failure.
    • Related: feat(roadmap): the implement Job gates before its PR #4719, which asks for a different change. Both target the runner resource limits in k8s/devops/cronjob-runner.yaml, but #4719 raises the CPU limit while this item removes a thread limit.
  3. added
    priority/p0-critical
    on Dec 1, 2026
  4. devops-cli-service commented on Dec 1, 2026

    @devops-cli-service
    ContributorAuthor

    Owner question: See the first point of Open questions in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  5. added
    owner/agent
    on Dec 1, 2026
  6. dan-petty commented on Dec 1, 2026

    @dan-petty
    Owner

    Cause of the limit, measured on 2026-12-01. The proposed design above (Git index.threads=1, or a higher podPidsLimit) does not remove it.

    Fix: start devops under tini, which reaps orphans (it is the init of docker run --init). The pull request of this item does this and adds an image smoke check. The question about the process limit needs no answer.

  7. devops-cli-service commented on Dec 1, 2026

    @devops-cli-service
    ContributorAuthor

    Next step: the alternatives check records a verdict. See the section Proposed design of the body.

  8. added
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Dec 1, 2026
  9. removed
    status/in-review
    owner/agent
    on Dec 1, 2026
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

    effort/mediumpriority/p0-criticalsource/agenttype/bugvalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions