Fix tini zombie reaping with shared process namespace#4114
Merged
Conversation
Add -s flag to tini to enable subreaper mode, which allows tini to properly reap zombie processes when shareProcessNamespace is enabled in Kubernetes deployments.
Contributor
There was a problem hiding this comment.
Code Review
The change correctly adds the -s flag to tini in Dockerfile to address zombie process reaping in shared process namespaces. However, the fix is incomplete. The tini entrypoint in playground/Dockerfile (line 114) is also missing the -s flag, which will lead to the same zombie process reaping failure this PR aims to solve. To ensure consistent behavior and prevent resource leaks from zombie processes, the -s flag should also be added to playground/Dockerfile.
squadgazzz
approved these changes
Feb 3, 2026
jmg-duarte
approved these changes
Feb 3, 2026
Contributor
I haven't run into any issues |
MartinquaXD
approved these changes
Feb 3, 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
Adds the
-s(subreaper) flag to tini in the Dockerfile entrypoint to fix zombie process reaping whenshareProcessNamespace: trueis set in Kubernetes deployments.Problem
Our Kubernetes deployments use
shareProcessNamespace: trueto allow sidecar containers (like the memory monitor) to access/procof the main process. However, this causes the following warning:When
shareProcessNamespaceis enabled, Kubernetes' pause container becomes PID 1 instead of tini:Without PID 1 status, tini cannot reap zombie (orphaned) child processes by default.
Solution
The
-sflag tells tini to register as a child subreaper via thePR_SET_CHILD_SUBREAPERprctl. This Linux kernel feature allows a non-PID-1 process to adopt and reap orphaned descendant processes, restoring proper zombie cleanup.