-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Process oom_score_adj is set to -1000 after termination by oom-killer #20765
Comments
crun itself doesn't handle the restart, so the bug could be in Podman. Could you please check the |
There is no oomScoreAdj specified:
|
when the oomscore is not specified, crun doesn't change it. This seems like a Podman issue, thanks for the additional information. |
the regression was introduced by conmon containers/conmon@813c8d7 |
When the exit command is executed, the oom score is restored to its original value otherwise the command runs with -1000. Closes: containers/podman#20765 Signed-off-by: Giuseppe Scrivano <[email protected]>
proposed patch: containers/conmon#464 |
I can confirm that I can not see this problem after downgrading to conmon v2.1.7 in my testing scenarios |
When the exit command is executed, the oom score is restored to its original value otherwise the command runs with -1000. Closes: containers/podman#20765 Signed-off-by: Giuseppe Scrivano <[email protected]>
When the exit command is executed, the oom score is restored to its original value otherwise the command runs with -1000. Closes: containers/podman#20765 Signed-off-by: Giuseppe Scrivano <[email protected]>
Issue description
When a container is restarted after its process is terminated by oom-killer due to exceeding memory limits, the process in the restarted is assigned an oom_score_adj value of -1000.
The process is therefore unkillable by oom-killer after the first restart, which keeps the container running even when exceeding memory limits agian, and triggers excessive logging.
Steps to reproduce the issue
Container and systemd config using podman kube play:
systemd daemon-reload && system start stress
cat /proc/<pid>/oom_score_adj
Describe the results you received
A container that was killed due to OOM cannot be killed automatically because its process is assigned an oom_score_adj of -1000. The container can manually be stopped or restarted however. The syslog indicates that the kernels oom-killer cannot find a process to kill to free more memory ("Out of memory and no killable processes...")
/var/log/messages
The syslog shows that the containers process has been assigned the oom_score_adj as specified in the systemd unit when first started. oom-killer is invoked and terminates the process successfully. Podman registers that the container died and restarts it. Upon again reaching the memory limit, oom-killer only finds processes with a oom_score_adj of -1000 and is therefore unable to kill any process.
podman container inspect
After restart triggered by oom-killer ("HostConfig.OomScoreAdj": 0):
Describe the results you expected
A container that was killed due to OOM can be killed automatically because its processes are not assigned an oom_score_adj of -1000, unless specifically specified.
crun version
podman info output
Additional environment details
The text was updated successfully, but these errors were encountered: