New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug 1875946: Pod process container does not correctly reap zombie process with shareProcessNamespace: true #27
Conversation
Hi @psykulsk. Thanks for your PR. I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/assign @smarterclayton |
/cc @soltysh |
@psykulsk: GitHub didn't allow me to request PR reviews from the following users: soltysh. Note that only openshift members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/assign @soltysh |
@psykulsk: GitHub didn't allow me to assign the following users: soltysh. Note that only openshift members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@smarterclayton @derekwaynecarr @soltysh could you have a look at this or assign someone else? Thanks! |
@mrunalp can you asisgn a reviewer for this and verify consistency with kube pause.c? |
/ok-to-test |
@psykulsk: This pull request references Bugzilla bug 1875946, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Yeah, looking! |
Could you either squash or clean up the commits? |
22c6f61
to
3b58f79
Compare
/retest |
3b58f79
to
2a5d388
Compare
da2389c
to
d4db9c3
Compare
/retest |
ab0c3d5
to
aed3c66
Compare
/retest |
2 similar comments
/retest |
/retest |
This looks fine besides 2 final nits. Thanks 👍 |
aed3c66
to
617000a
Compare
/lgtm |
@mrunalp: changing LGTM is restricted to collaborators In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/test e2e-aws-upgrade |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tagging based on @mrunalp review
/lgtm
/approve
@soltysh: changing LGTM is restricted to collaborators In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@smarterclayton ptal for approve/lgtm |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mrunalp, psykulsk, smarterclayton, soltysh The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@psykulsk: All pull requests linked via external trackers have merged: Bugzilla bug 1875946 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/cherry-pick release-4.5 |
@haircommander: new pull request created: #57 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
The purpose of this pull request is to add handling the SIGCHLD signal and proper reaping of the zombie processes to the
pod
binary.This is to avoid exhaustion of the process table slots in some long running scenarios and to keep the behavior of pods consistent with the vanilla kubernetes distribution, when using shareProcessNamespace: true.
Why
The default configuration of the cri-o deployed by Openshift/OKD (version 4) specifies the
pause_command = "/usr/bin/pod"
. This means that when the user spawns a pod withshareProcessNamespace: true
, the pod binary will be launched as the init process in the pod's pid namespace. If one of the containers in that pod has an exec readiness probe configured, that executes some kind of command that may sometimes exceed the readiness probe's timeout, all processes launched by this command will be left as zombie/defunct processes and will never be cleaned up. That's because the /usr/bin/pod, running as the PID 1 process, does not currently handle the SIGCHLD signal and does not reap the zombie processes. Over a longer time span this may fill the process table size available inside the container namespace and cause errors like "Cannot fork" and cause other problems during the pod's main container runtime.The pause container used in the vanilla kubernetes distribution handles the SIGCHLD and reaps the zombies as can be seen in the source code.
Steps to reproduce on OKD/Openshift 4 cluster
shareProcessNamespace: true
and an exec readiness probe that will timeout. Example of a pod:kubectl exec -it test bash
, run thetop
command, and observe how a new zombie process appears every 3 seconds.Steps to reproduce with Docker (or other container runtime)
pod
binary. For example, use the image from the latest release of OKD (pod
image specified here).top
.top
output.When you repeat steps mentioned above, but with an image that contains
pod
binary with the added SIGCHLD handling, no zombie processes are left hanging.References: