-
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
v1.1.6 regression (rootless, cgroup v2): container's cgroup is not empty: 5 process(es) found
#3828
Comments
This is caused by 12f2f03 . |
So, if the cgroup exists and is not empty, and the systemd cgroup driver is used, this almost always means that the systemd unit also exists. Previously, this was not causing any visible issues because systemd cgroup driver used to ignore UnitExists. But under the hood, the new container was started without adding its PID into the proper cgroup, and without setting properties for systemd unit. This is a very critical bug, which runc 1.1.6 fixes. The side effect is, if a systemd cgroup driver is used, it errors out. To me, this is way better than running a container without placing it into a proper cgroup. Now, if it errors out, it means something is very wrong. @AkihiroSuda I am not familiar with nerdctl codebase, but can take a look early next week. |
In other words, I had a choice between:
I chose 2 because otherwise it's a huge issue. |
Thanks, help is appreciated. |
Reproduced locally. So, what happens is, the containerd is killed by the test, but the container is still running. Here's an excerpt from the logs: Event 1: container is created:
Event 2: containerd is killed and restarted:
Event 4: containerd sees the dead shim, tries to clean it up and restart the container:
💡 what we see here is a running container, which was started before containerd was killed. |
With some added debug, I see that containerd tries to
This error happens when container's @AkihiroSuda I don't know much about rootlesskit and nerdctl, but it seems that restarting containerd makes the runc root directory to disappear. I guess, what happens is For runc, if the container's For CC @AkihiroSuda |
Thanks @kolyshkin ! |
To sum it up (and close the issue). To address the issue of NOT creating the systemd unit if it already exists, runc 1.1.6+ is rejecting to create a container if its cgroup is not empty. For reasons described in #3132, sharing a cgroup between multiple containers is always a bad idea, and thus runc 1.2 will always reject such configuration. Runc 1.1.6+ does that already, but only if using systemd cgroup manager, as it is impossible to create a systemd unit otherwise. For more details, see |
Description
nerdctl test suite no longer passes with runc v1.1.6 (rootless, cgroup v2), due to an error like
container's cgroup is not empty: 5 process(es) found
Steps to reproduce the issue
https://github.com/containerd/nerdctl/blob/v1.3.0/cmd/nerdctl/container_run_restart_linux_test.go#L33
Describe the results you received and expected
runc v1.1.5: passes
runc v1.1.6: fails
What version of runc are you using?
Host OS information
Host kernel information
The text was updated successfully, but these errors were encountered: