Repository navigation
Description
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
runnercase of.github/actions/image-smoke/action.ymlruns against the built runner image in the image job of.github/workflows/ci.yml - THEN the check prints the image entrypoint
tini -- devopsand 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
devopsdirectly - 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 hadolintruns after the change toDockerfile - 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,zizmorruns 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 lstatand no/bin/sh: Cannot fork, and thegit add -Astep 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 lstatstop 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 thepodPidsLimitof 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 startsdevopsas 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 withunable to create threaded lstat: Resource temporarily unavailable. [sources: docs/guidelines/kubernetes.md:129] - Which init reaps the orphaned children of PID 1?: Start
devopsundertinias PID 1, withENTRYPOINT ["tini", "--", "devops"]in the runner stage of the imageDockerfile. (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 ofdevopsreaps 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.
- Chosen: tini as PID 1. It is the init of
- 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
podPidsLimitdoes 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 kubeletpodPidsLimitonly 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=1remove 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 thetinipackage and setENTRYPOINT ["tini", "--", "devops"]at the line that holdsENTRYPOINT ["devops"]today. One entrypoint covers theprepare,agentandpublishcontainers of the runner Job. The CronJob sets onlyargs(k8s/devops/cronjob-runner.yaml:61), and the admission policy refusescommandin 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
Dockerfileentrypoint. One line covers every container of the runner Job and the admission policy keepscommandout 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.
- Chosen: Image
- Where do the smoke check and its offline-testable verdict live?: In the
runnercase of.github/actions/image-smoke/action.yml, with the verdict in a pure function insrc/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 k8slive 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
devops-cli-service commentedon Dec 1, 2026
runner, and .github/labels.yml declares no scope/runner label. Add the label to the file to give the scope to this item.The implement Job stops with git add -A failed, which is a CI failure.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.devops-cli-service commentedon Dec 1, 2026
Owner question: See the first point of Open questions in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
dan-petty commentedon Dec 1, 2026
Cause of the limit, measured on 2026-12-01. The proposed design above (Git
index.threads=1, or a higherpodPidsLimit) does not remove it.podPidsLimitof 4096: fix(roadmap): plan files keep the cost mark and line estimates #5217 on v0.270.1 and fix(roadmap): a spent verification failure is not ci_infra #7986 on the release before. The other implement Jobs of the same 12 hours peaked at 141 or less (container_threads).node_processes_state{state="Z"}rose from 16 at 16:53 to 4078 and fell to 3 when the pod ended. The tasks are zombies.OS can't spawn worker threadfromruff, then/bin/sh: Cannot forkfrom each command. It spent 46 million input tokens.ENTRYPOINT ["devops"], sodevopsis PID 1. It waits only for its own children. Each orphan of a command of the agent stays a zombie until the pod ends.Fix: start
devopsundertini, which reaps orphans (it is the init ofdocker 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.devops-cli-service commentedon Dec 1, 2026
Next step: the alternatives check records a verdict. See the section Proposed design of the body.
devops-cli-service commentedon Dec 1, 2026
Released in v0.270.4: https://github.com/dan-petty/devops-cli/releases/tag/v0.270.4