-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
libct/cg/sd/v2: fix ENOENT on cgroup delegation #3389
Conversation
Apparently, not all files listed in /sys/kernel/cgroup/delegate must exist in every cgroup, so we should ignore ENOENT. Dot not ignore ENOENT on the directory itself though. Change cgroupFilesToChown to not return ".", and refactor it to not do any dynamic slice appending in case we're using the default built-in list of files. Fixes: 35d20c4 Signed-off-by: Kir Kolyshkin <[email protected]>
@frasertweedale PTAL |
/lgtm Thanks for the fix @kolyshkin . I'll also create a PR against runtime-spec to add a note about the possibility of missing files. |
Not all files listed in /sys/kernel/cgroup/delegate necessarily exist in all cgroups. For example, see this issue and PR: - opencontainers/runc#3387 - opencontainers/runc#3389 Expand the cgroup ownership semantics to ensure that runtime authors are aware of this possibility and implementations handle it gracefully. Signed-off-by: Fraser Tweedale <[email protected]>
@opencontainers/runc-maintainers PTAL 🙏🏻 |
} | ||
} else { | ||
filesToChown = append(filesToChown, "cgroup.procs", "cgroup.subtree_control", "cgroup.threads") | ||
if 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.
Can we logrus.Debugf the err?
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.
LGTM, thanks!
Apparently, not all files listed in
/sys/kernel/cgroup/delegate
mustexist in every cgroup, so we should ignore ENOENT.
Dot not ignore ENOENT on the directory itself though.
Change
cgroupFilesToChown
to not return.
, and refactor it to not doany dynamic slice appending in case we're using the default built-in
list of files.
Fixes: #3387
Fixes: 35d20c4