Repository navigation
fix(docker): run the proxy under tini to reap orphans - #88
Merged
Merged
Conversation
As PID 1 the proxy never reaps orphaned git processes: the detached auto maintenance after each fetch and the descendants of a killed process group. They pile up as zombies until the PID limit is hit. Closes rolandjitsu#87 Assisted-by: Claude:claude-opus-5-5
profiling
marked this pull request as ready for review
November 24, 2026 02:30
rolandjitsu
approved these changes
Nov 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Summary
Closes #87. In the image the proxy is PID 1, so orphaned
gitprocesses are reparented to it and never reaped: the detachedgit maintenance run --autoafter every fetch, and the descendants of a killed process group (on cancel or client disconnect). Zombies pile up until the PID limit is hit, then every request fails.Run the proxy under tini instead of fixing this in the proxy. Reaping orphans is the init's job, and the leak only exists when the proxy is PID 1, which only happens in a container.
TINI_SUBREAPER=1keeps it reaping (without a warning) when another init is PID 1, e.g.docker run --initor a shared Kubernetes PID namespace.Verified on a local amd64 build of this branch, 5 fetches plus 3 clones killed mid-transfer:
latest)--init--read-only,--cap-drop ALL,no-new-privilegesSIGTERM still drains and exits 0; the image still runs as 10001 and passes
/readyz.Tests
The Package workflow gains "Check orphaned processes are reaped": it orphans a process inside the smoke container and fails if it stays a zombie. It fails on the 0.2.14 image and passes on this one. arm64 is covered by the same workflow's build matrix (not built locally).
Checklist
cargo fmt --all --check,cargo clippy --all-targets --all-features --locked -- -D warnings,cargo test --all-featuresAssisted-by:trailer (see CONTRIBUTING.md / AGENTS.md)Breaking change?
No for flags, env, and cache layout: arguments still append to the entrypoint. Inside the container, PID 1 is now tini and the proxy runs under it; signals are forwarded. Overriding the entrypoint (
--entrypoint, Kubernetescommand:) bypasses tini, the same as today.