-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Daemon: passdown the --oom-kill-disable
option to containerd
#36201
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
Conversation
Current implementaion of docke daemon doesn't pass down the `--oom-kill-disable` option specified by the end user to the containerd when spawning a new docker instance with help from `runc` component, which results in the `--oom-kill-disable` doesn't work no matter the flag is `true` or `false`. This PR will fix this issue reported by moby#36090 Signed-off-by: Dennis Chen <dennis.chen@arm.com> Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
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
Just tested, fix works for me. |
Thanks @dnephin for the review 👍 |
Looks like this was introduced in 45d85c9 (#34356), which is part of 17.09 ping @mlaventure Should we have a unit-test for this? |
Hello @thaJeztah , seems we've already have a corresponding test file for the |
Yes, so I was wondering why none of the tests caught this |
Ah, the reason I have mentioned in PR #36185
That comes from the
I think we can remove the |
BTW: on our Linux/arm64 system, |
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.
Ah right; that would explain
LGTM
Thanks @thaJeztah for the quick response 👍 |
Yw! Can you do a follow up to update the test conditions (as discussed above?) |
Now that the `-m` flag can work in case of cgroup swap memory limit isn't enabled, also we have PR moby#36201 merged, so now we can remove the `swapMemorySupport` from `testRequires()` order to trigger the real test on those platforms which don't enable cgroup swap mem limit. Signed-off-by: Dennis Chen <dennis.chen@arm.com>
Absolutely. Please see PR #36229 😄 |
Current implementaion of docke daemon doesn't pass down the
--oom-kill-disable
option specified by the end user to the containerdwhen spawning a new docker instance with help from
runc
component, whichresults in the
--oom-kill-disable
doesn't work no matter the flag istrue
or
false
.This PR will fix this issue reported by #36090
Signed-off-by: Dennis Chen dennis.chen@arm.com
Signed-off-by: Jianyong Wu jianyong.wu@arm.com
- What I did
Fix
--oom-kill-disable
issue- How I did it
Pass down the actual value of the
--oom-kill-disable
specified by the end user to the containerd- How to verify it
Run a container which will use up all the limited memory soon, like this:
/home/dennis/test# docker run -d -v "$PWD:/tmp" --oom-kill-disable=true -m 10MB --name oomk-disable busybox sh -c /tmp/oom.sh
oom.sh
is a script to use up the memory quickly:We can verify this in 2 methods:
When the new docker instance spawned, there is a new generated folder under the
/sys/fs/cgroup/memory/docker
looks like/sys/fs/cgroup/memory/docker/423797dba327678cd5c3e4eb5e8723019c1aaeface3fab3755be3fd454b36076
in my system, then we cancat memory.oom_control
file in this folder to verify if the--oom-kill-disable
works or not.Before this PR, the
oom_kill_disable
filed in the filememory.oom_control
is always 0 no matter wedocker run
a container with--oom-kill-disable
astrue
orfalse
. After this PR applied, thememory.oom_control
will be changed according to the actual value assigned by the end user.Launch another terminal then run
docker events
to watch the events when running/home/dennis/test# docker run -d -v "$PWD:/tmp" --oom-kill-disable=true -m 10MB --name oomk-disable busybox sh -c /tmp/oom.sh
Without this PR, the events will be:
With this PR, the events will be:
We can see that the
--oom-kill-disable=true
works after applied this PR, consequently theDockerSuite.TestEventsOOMDisableFalse
test case passed.- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)
