Repository navigation
fs2: thaw the cgroup if freezing fails - #108
Merged
Merged
Conversation
Contributor
Author
|
I had an impression that cgroup v2 can't fail on us like that and this is why I haven't added that kind of fix (which is currently only present in cgroup v1). Apparently it can. |
thaJeztah
reviewed
Dec 3, 2026
| ) | ||
|
|
||
| func setFreezer(dirPath string, state cgroups.FreezerState) error { | ||
| func setFreezer(dirPath string, state cgroups.FreezerState) (Err error) { |
Member
There was a problem hiding this comment.
nit; can you use retErr instead of Err (I think that's what we use in most / various other places)
Contributor
Author
There was a problem hiding this comment.
fixed (I remember though that @cyphar usually uses Err in such cases, so we might have a few in this repo).
thaJeztah
reviewed
Dec 3, 2026
| defer func() { | ||
| if Err != nil { | ||
| // Freezing failed (most probably timed out, as some | ||
| // tasks in the cgroup can't be frozen while in an |
Member
There was a problem hiding this comment.
wondering if the comment here is a bit too much; also because of the various assumptions around causes described
Contributor
Author
There was a problem hiding this comment.
You're right; my AI friends are a bit too talkative. Fixed.
Freezing a cgroup v2 can time out: a task in an uninterruptible or killable sleep (e.g. waiting for a FUSE or NFS reply) does not reach the freezer trap, so the cgroup does not become frozen. In this case cgroup.freeze stays set to 1 and the cgroup is left in the freezing state. As a result, every subsequent getFreezer call (and thus every runc command which needs the container state, including resume, exec, kill and delete --force) fails with the same freeze timeout until the blocked task wakes up. Thaw the cgroup back if freezing failed, as cgroup v1 freezer already does. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
kolyshkin
force-pushed
the
fs2-thaw-on-freeze-fail
branch
from
December 3, 2026 06:58
bd93310 to
577a366
Compare
odinuge
approved these changes
Dec 4, 2026
Merged
via the queue into
opencontainers:main
with commit Dec 4, 2026
a6a9e35
19 of 22 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Freezing a cgroup v2 can time out: a task in an uninterruptible or killable sleep (e.g. waiting for a FUSE or NFS reply) does not reach the freezer trap, so the cgroup never becomes frozen.
cgroup.freezethen stays set to 1, and every subsequentgetFreezercall fails with the same 10s freeze timeout. For runc this meanspausefails, and thenstate,resume,exec,killanddelete --forceall fail too, until the blocked task wakes up.This thaws the cgroup back if freezing failed, as the cgroup v1 freezer already does.
Reproduced on Fedora 45 (kernel 7.2.11, cgroup v2) by bind-mounting a fuse-overlayfs mount into a container, stopping the FUSE daemon with SIGSTOP, and running
staton that mount inside the container beforerunc pause. Without this fix, every command afterpausefails after 10s. With it, the container stays running and all commands work.Supersedes opencontainers/runc#5650.
Found by oss-scanner: ANT-2026-AJESWKFI