cri: fix memory.memsw.limit_in_bytes: no such file or directory#7836
cri: fix memory.memsw.limit_in_bytes: no such file or directory#7836dmcgowan merged 1 commit intocontainerd:mainfrom
memory.memsw.limit_in_bytes: no such file or directory#7836Conversation
Skip automatic `if swapLimit == 0 { s.Linux.Resources.Memory.Swap = &limit }` when the swap controller is missing.
(default on Ubuntu 20.04)
Fix issue 7828 (regression in PR 7783 "cri: make swapping disabled with memory limit")
Signed-off-by: Akihiro Suda <[email protected]>
c2f233b to
4157503
Compare
MikeZappa87
left a comment
There was a problem hiding this comment.
+1 for your error messages.
mikebrow
left a comment
There was a problem hiding this comment.
have to be fast around here to get in a code review :-O
| s.Linux.Resources.Memory.Limit = &limit | ||
| // swap/memory limit should be equal to prevent container from swapping by default | ||
| if swapLimit == 0 { | ||
| if swapLimit == 0 && swapControllerAvailable() { |
There was a problem hiding this comment.
What do you think about line 488 below?
There was a problem hiding this comment.
the merged commit is to a regression.. my question is more to the question of how far down the chain should we go to find the setup error for a pod with a swap limit set on a node that doesn't have swap enabled..
There was a problem hiding this comment.
I have the same question but the line was not touched in #7783 so I left it as-is. Can be discussed in a separate issue/PR.
|
@AkihiroSuda I got failed TestUpdateOCILinuxResource when upgrading containerd to 1.6.14. The reason is I'm building containerd in schroot, which doesn't have cgroup. So swapControllerAvailable is false. However TestUpdateOCILinuxResource expects a non nil swap value. I'm not sure how best we can fix that. swapControllerAvailable is not exported to pkg/cri/server. |
Perhaps the |
Skip automatic
if swapLimit == 0 { s.Linux.Resources.Memory.Swap = &limit }when the swap controller is missing. (default on Ubuntu 20.04)Fix #7828 (regression in PR #7783 "cri: make swapping disabled with memory limit")