Daemon: passdown the --oom-kill-disable option to containerd#36201
Daemon: passdown the --oom-kill-disable option to containerd#36201thaJeztah merged 1 commit intomoby:masterfrom
--oom-kill-disable option to containerd#36201Conversation
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>
|
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, |
thaJeztah
left a comment
There was a problem hiding this comment.
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-disableoption specified by the end user to the containerdwhen spawning a new docker instance with help from
runccomponent, whichresults in the
--oom-kill-disabledoesn't work no matter the flag istrueor
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-disableissue- How I did it
Pass down the actual value of the
--oom-kill-disablespecified 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.shoom.shis 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/dockerlooks like/sys/fs/cgroup/memory/docker/423797dba327678cd5c3e4eb5e8723019c1aaeface3fab3755be3fd454b36076in my system, then we cancat memory.oom_controlfile in this folder to verify if the--oom-kill-disableworks or not.Before this PR, the
oom_kill_disablefiled in the filememory.oom_controlis always 0 no matter wedocker runa container with--oom-kill-disableastrueorfalse. After this PR applied, thememory.oom_controlwill be changed according to the actual value assigned by the end user.Launch another terminal then run
docker eventsto 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.shWithout this PR, the events will be:
With this PR, the events will be:
We can see that the
--oom-kill-disable=trueworks after applied this PR, consequently theDockerSuite.TestEventsOOMDisableFalsetest case passed.- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)
