-
Notifications
You must be signed in to change notification settings - Fork 38.9k
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 doesn't recognize child process oom kill #78973
Comments
/sig node |
Thanks for sharing this issue! To be sure I'm understanding, the problem your describing is the following: k8s has a main process, lets call it ProcessA, which is functioning normally. There is an additional process, lets call it ProcessB, which is also running on the container, but it was started through an Does this expectation arise from the documentation? Or are you requesting that k8s work that way? |
I expect that pod would be restarted ( though not sure enough, I think you have more experience about this ), I'm surfacing this issue here In some way, I just encounter the problem, and suspect the pod to be restarted, so we can know the problem earlier, otherwise, it may need manual restart the pod ( as currently we do, and it's happen frequently ) I'd like to hear your thoughts by reading the code, is that only pod exit, then the oom event will be received by docker-ce and then to kubelet? will this parameter help?
|
I would like someone else to confirm, but I believe that a container will only be considered a "failure" if its main process fails. I wonder, is there anyway that we could use the liveness probe here to accomplish your aims? I think that's what k8s typically uses for custom health checks. Alternatively, I wonder if there's also a way to make the failure of the child process lead to the failure of the parent process? I don't believe that the |
One last thought - I think that you may get the quickest answer if you close this issue and instead ask your question in the #sig-node channel on the k8s slack. I've found it to be slightly quicker for these types of problems. |
Thanks. your reply is very helpful ( I'll try slack too ). I'll consider try to have such liveness probe, from a brief look, it seems not an easier way ( I don't see any clue how php-fpm can do it, I'm actually don't know php well, it's my colleague writing service in php ). Using liveness probe have some feels like a workaround, maybe we can solve it once for all the similar case ( rather than implement a more complex liveness probe everywhere ? ), or in other word ( solve it by get the notify of cgroup oom event is the right way? I'm not sure though ).
I have the same thought too, so I create this issue ( to surface it up, and for the better discussion of an issue ). |
If your main process is forking, it should be fail if a critical child fails / restart the child itself, or you need to use a liveness probe. It's expected that child processes might exit for various reasons and it would be a breaking change to restart pods when a child process exits. I'm having some trouble finding a documentation page that calls this out specifically. However, the same is true of eg |
see also this previous issue #50632 (comment) |
I'd curious how this is going
// maybe someway of annotation to change oom behavior? |
@kubernetes/sig-node-feature-requests |
This is potentially related to containerd/cgroups#74 as well. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closing this issue. 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. |
I encountered same issue, that I found my child process got oom killed by Linux oom killer, but my pid=1 process remain running. So I took the experiment couples of times, only to find sometimes child process got killed (the same as above), and sometimes the pid=1 process got killed, the pod OOMKilled, which is pretty wired. My kernel is 4.4, stil not clear after reading oom_kill.c code |
What happened:
There's php-fpm pod, which have many child process, somehow the child process got oom killed
What you expected to happen:
Expect pod to restart
How to reproduce it (as minimally and precisely as possible):
create pod with command:
stress --cpu 1 --io 1 --vm 1 --vm-bytes 200M --timeout 30s --backoff 3m
kubectl exec pod shell, execute extra command:
stress --cpu 1 --io 1 --vm 1 --vm-bytes 200M --timeout 30s --backoff 3000000
// this extra command will be oom killed(
journalctl -k -e -f
), but pod still running normallyfor normal oom kill
run pod with command below
stress --cpu 1 --io 1 --vm 1 --vm-bytes 200M --timeout 30s --backoff 3000000
From the test, I found it's relate to the php-child process, the main process killed does cause pod restart correctly.
For more oom logs https://pastebin.com/ECdhtg2z ( oom repeat happen )
Cluster information:
Kubernetes version: v1.14.1
Cloud being used: (put bare-metal if not on a public cloud)
Installation method: kubeadm
Host OS: centos CentOS Linux release 7.4.1708, 4.14.15-1.el7.elrepo.x86_64
CNI and version: kube-router:v0.3.0
CRI and version: 18.06.2-ce
The text was updated successfully, but these errors were encountered: