-
Couldn't load subscription status.
- Fork 2.2k
Fix invalid handling of pids.limit=0 from runtime spec #4023
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -122,11 +122,11 @@ other options are ignored. | |
| }, | ||
| cli.StringFlag{ | ||
| Name: "memory-swap", | ||
| Usage: "Total memory usage (memory + swap); set '-1' to enable unlimited swap", | ||
| Usage: "Total memory usage (memory + swap); use '-1' to enable unlimited swap", | ||
| }, | ||
| cli.IntFlag{ | ||
| Name: "pids-limit", | ||
| Usage: "Maximum number of pids allowed in the container", | ||
| Usage: "Maximum number of tasks; use '-1' for unlimited", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe some users will be confused with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| }, | ||
| cli.StringFlag{ | ||
| Name: "l3-cache-schema", | ||
|
|
||
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 don't know whether upstream projects should write such codes or not when they update the container's pids limit?
@AkihiroSuda Do you know what's the situation in
nerdctl.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.
Maybe in kubelet they should know this information:
https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/cm/cgroup_manager_linux.go#L355-L381
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.
So I still think we should fix it in
pids.go, because others always useManager.Setdirectly without usespecconv.But we have to solve 2 problems if we choose solutions like #4015 :
pids.maxifPidsLimit == 0;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 took a look at git history, and it seems that libcontainer always treated
0as unset for pids limit, since commit db3159c from January 2016 that added the initial pids limit support (alas, the very same commit incorrectly documents the field (db3159c#diff-b71b6973c045d22e41e802cf65cade82c573a844190bc0d06a6ade9f21cb2c5c), and this PR fixes that).Thus, I am pretty sure libcontainer users are aware of what 0 means for pids limit in libcontainer; yet I am going to look into kubernetes and nerdctl to confirm.
Now, we have two problems to solve:
I think that 2 is much less of a problem than 1, and can be solved by properly documenting the PidsLimit field (this is what this PR does).
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.
FWIW: case 1 is the only case I care about fixing