-
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
fix data inconsistent when runc update in systemd driven cgroup #2343
Conversation
If it makes sense, the same changes can be added to cgroup v1. |
1cbeee9
to
56a3df2
Compare
libcontainer/cgroups/systemd/v2.go
Outdated
} | ||
return fsMgr.Set(container) |
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.
some resources are not controlled by systemd so we still need to call this I'm afraid.
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.
and this is why CI is failing (systemd does not control cpuset)
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.
Force pushed now.
I don't know whether we should change to only write cpuset
cgroup files or not?
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 think the best is to keep it like it is now (with writing all of them), and then we can look at it in another PR/issue. This also applies to other resources not set via systemd like hugetlb.
More info about it here: https://systemd.io/CGROUP_DELEGATION/
56a3df2
to
0f2f7cd
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.
Thanks for doing this @lifubang! This change looks good to me, but as you say it also applies to cgroup v1, so it would be nice if you could fix that at the same time!
Issue depending on this in kubernetes: kubernetes/kubernetes#88197
OK, I'll fix and test it in cgroup v1. |
Signed-off-by: lifubang <[email protected]>
Signed-off-by: lifubang <[email protected]>
0f2f7cd
to
1d4ccc8
Compare
OK, I'll do it later. |
04acdac
to
619f823
Compare
Signed-off-by: lifubang <[email protected]>
619f823
to
10ba72a
Compare
Three tests has been added. |
fix #2287
runc --systemd-cgroup update does not update systemd scope
As pointed out by @kolyshkin
The cause of this is Set() method of systemd.UnifiedManager, which only uses fsManager to set the updated values.
So when we use systemd driven cgroup v2, we should use
SetUnitProperties
method to update container resource constraints.Signed-off-by: lifubang [email protected]