Skip to content
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

Support cgroup.kill in cgroupv2 manager #229

Closed
jseba opened this issue Apr 11, 2022 · 3 comments
Closed

Support cgroup.kill in cgroupv2 manager #229

jseba opened this issue Apr 11, 2022 · 3 comments

Comments

@jseba
Copy link
Contributor

jseba commented Apr 11, 2022

Kernel 5.14 added support for a cgroup.kill file in cgroupv2; writing "1" to this file will immediately send SIGKILL to all processes in that cgroup hierarchy.

I have a local change to support this feature in this library but I wasn't sure which way would be the preferred method. I'm currently checking the kernel release information from uname(2) to see if the kernel version has the feature, but this is expensive (handled by a sync.Once wrapper) and I can't be sure that no-one will backport this to an older kernel (not likely but not not a possibility).

The other approach would be to just blindly send the write out and if an error is returned, just assume it's not supported and tell the caller that. An improved variant of this approach would be to have a fallback that walks the processes in the cgroup hierarchy and freezes/kills/thaws them (this is the approach used by libcontainer in runc).

@dcantah
Copy link
Member

dcantah commented Dec 27, 2022

@jseba Write -> fail -> fallback to libcontainer approach sounds fine to me. Do you still have a workable branch?

@dcantah
Copy link
Member

dcantah commented Dec 31, 2022

@jseba I made a change here with this work if you still want this: #263. Thanks for making this issue!

@dcantah
Copy link
Member

dcantah commented Jan 3, 2023

#263 was checked in, closing this

@dcantah dcantah closed this as completed Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants