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
kubelet: Pods created and rapidly terminated get stuck #98424
Conversation
@rphillips: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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. |
/retest |
9690243
to
c3cc0d4
Compare
c3cc0d4
to
f35bb71
Compare
f35bb71
to
78775d5
Compare
78775d5
to
a94d9ba
Compare
/cc @SergeyKanzhelev |
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.
This generally looks like an improvement to me (yay thread safety!!)
I'd love to see what this looks like against some of the e2es that are frequently failing. @rphillips I think some of them are OpenShift-only, do you want me to try porting them back to k8s? Maybe I can run them against this patch in another DNM PR?
3215c07
to
a87e5b7
Compare
/test pull-kubernetes-e2e-gce-ubuntu-containerd |
9679fbd
to
3cdd573
Compare
do not delete the cgroup from a pod when it is being killed
3cdd573
to
f918e11
Compare
/retest |
Added a lock for the final validation step. |
/lgtm |
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.
/lgtm
/test pull-kubernetes-e2e-kind |
@rphillips: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
I think this PR could consider cherrypick? |
@rphillips Just want to confirm, without this fix, the issue is pod is sometimes stuck in terminating phase due to cgroup clean up issue? Thanks! |
What type of PR is this?
/kind bug
/sig node
What this PR does / why we need it:
This PR fixes the race when a pod gets terminated but crio has not had the chance to clean up the cgroup yet. The podKiller will register all pods into a map and bypass the cgroup cleanup in cleanupOrphanedPodCgroups if the kill is still pending.
In Openshift, we are seeing an issue where pods can be deleted from the API and the cgroup is torn down before the pod is completely killed. This is due to the Kubelet seeing the terminated pod from the API and the housekeeping routine (runs every 2 seconds) starts cleaning up the cgroup (cleanupOrphanedPodCgroups) if cgroupPerQOS is enabled.
The fix skips over the cgroup cleanup if the pod is being killed by podKiller. Once the pod exits the podKiller then
pcm.Destroy
is called within cleanupOrphanedPodCgroups.Which issue(s) this PR fixes:
Fixes #98142
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: