-
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
[WIP] cgroupv2: fix systemd driver not putting pid into cgroup #2311
Conversation
Let me test this first... |
8bb3bc3
to
5965d16
Compare
Temporary
|
Tested locally, I confirm it fixes the issue. |
Hmm, I don't see Travis CI in the list of checks here :-\ |
5965d16
to
afb60fa
Compare
Travis succeeds (see results here: https://travis-ci.org/github/opencontainers/runc/jobs/674240854)
Removing temp patches. |
Fixes: opencontainers#2310 Signed-off-by: Kir Kolyshkin <[email protected]>
afb60fa
to
8b1c80c
Compare
This one is ready to be merged |
@@ -151,6 +151,9 @@ func (m *UnifiedManager) Apply(pid int) error { | |||
if err := createCgroupsv2Path(path); err != nil { | |||
return err | |||
} | |||
if err := cgroups.WriteCgroupProc(path, pid); err != nil { |
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.
isn't it done automatically by systemd?
I see we are specifying the PID here: https://github.com/opencontainers/runc/blob/master/libcontainer/cgroups/systemd/unified_hierarchy.go#L61-L63
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 see that systemd v1 driver (aka LegacyManager
) is doing it explicitly:
- Apply -> joinCgroups -> join for all controllers except cpuset
- ... -> cpuset.ApplyDir for cpuset
if err := cgroups.WriteCgroupProc(path, pid); err != nil { |
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 guess it is done because some controllers are not supported by systemd (like cpuset). On cgroup v2 it is enough to join the cgroup once.
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.
@giuseppe you're right, adding PIDs property should be enough, and yet it is not working. Investigating.
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'd investigate if dbusConnection.StartTransientUnit
waits correctly that the systemd unit is created. Does it eventually join the correct cgroup if you add a sleep here?
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.
See #2310 (comment)
See here: I guess we can close this one, but we still need to figure out what to do about getting the error back from systemd, if it fails. |
Apparently, the driver never cared to add pid to the cgroup.
Fixes: #2310