-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
set the default value of CpuBurst to nil instead of 0 #4211
set the default value of CpuBurst to nil instead of 0 #4211
Conversation
ef2c491
to
dda00b4
Compare
update.go
Outdated
@@ -216,7 +215,6 @@ other options are ignored. | |||
opt string | |||
dest *uint64 | |||
}{ | |||
{"cpu-burst", r.CPU.Burst}, | |||
{"cpu-period", r.CPU.Period}, | |||
{"cpu-rt-period", r.CPU.RealtimePeriod}, | |||
{"cpu-share", r.CPU.Shares}, |
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.
Shouldn't we distinguish nil from zero for all the fields?
See c9ba576
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.
Yes, I think we should deal with all this type fields. Could you please provide your PR link?
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.
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.
ping @lifubang @kolyshkin PTAL
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.
cherry-picked from your PR and add a testcase.
de4e7a4
to
7823197
Compare
74f4f7a
to
9172684
Compare
Is this currently a draft @lifubang ? |
@lifubang friendly ping? :) |
In issue opencontainers#4210, if we don't provide `--cpu-burst` in `runc update`, the value of cpu burst will always set to 0. Signed-off-by: lifubang <[email protected]>
Prior to this commit, commands like `runc update --cpuset-cpus=1` were implying to set cpu burst to "0" (which does not mean "leave it as is"). This was failing when the kernel does not support cpu burst: `openat2 /sys/fs/cgroup/runc-cgroups-integration-test/test-cgroup-22167/cpu.max.burst: no such file or directory` Signed-off-by: Akihiro Suda <[email protected]>
9172684
to
e4bf49f
Compare
@kolyshkin How about merge this to fix the |
I can confirm containerd tests pass now with this PR: https://github.com/containerd/containerd/actions/runs/8555412932/job/23442925228?pr=9313 |
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.
This is not totally right in my view, and also a tad overcomplicated, but it fixes a real bug, and a proper solution requires changes to cgroup managers.
Thus LGTM.
Fix #4210
We should set the default of
CpuBurst
to nil instead of 0 when we are updating a container's resource limit.