-
Notifications
You must be signed in to change notification settings - Fork 3.6k
cri: fix memory.memsw.limit_in_bytes: no such file or directory
#7836
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
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
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.
+1 for your error messages.
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.
have to be fast around here to get in a code review :-O
@@ -449,7 +481,7 @@ func WithResources(resources *runtime.LinuxContainerResources, tolerateMissingHu | |||
if limit != 0 { | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about line 488 below?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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")