fix: handle busy cgroup mounts on Bottlerocket - #181
Merged
Merged
Conversation
Bottlerocket can retain references to the inherited cgroup2 mount, causing the normal unmount to fail with EBnUSY and preventing dockerd from starting. Fall back to a lazy detach before installing the correctly rooted mount. If both unmount attempts fail, retain the inherited mount and continue with potentially degraded cgroup attribution rather than failing the workspace. Refs: https://linear.app/codercom/issue/PLAT-637
geokat
marked this pull request as ready for review
September 14, 2026 23:07
BobbyHo
reviewed
Sep 14, 2026
Only configure /init delegation after confirming that the cgroup mount is rooted at / in the new cgroup namespace. If neither unmount method can detach the inherited mount, or the replacement mount remains incorrectly rooted, start dockerd without nesting setup and warn that inner container cgroup attribution may be incorrect.
BobbyHo
approved these changes
Sep 15, 2026
BobbyHo
left a comment
There was a problem hiding this comment.
lgtm. Thank you for addressing my comments.
Starting dockerd in the new cgroup namespace with the inherited mount leaves the namespace and mount roots misaligned, causing the runtime to look for workspace cgroups at paths that do not exist. If neither unmount method can detach the inherited mount, re-enter the parent cgroup namespace before starting dockerd. This preserves workspace functionality while accepting potentially incorrect inner cgroup attribution. Fail explicitly if a replacement mount remains incorrectly rooted, since the original mount has already been detached.
Contributor
Author
|
Testing the fallback path on EKS showed that skipping the /init and subtree-control setup was not enough to restore functionality. |
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.
On Bottlerocket, runtime-held references to the inherited cgroup2 mount
can cause the normal unmount to fail with EBUSY, preventing dockerd
from starting.
Fall back to a lazy detach before installing the correctly rooted
mount. If neither unmount method can detach the inherited mount,
re-enter the parent cgroup namespace before starting dockerd. This
preserves workspace functionality with 0.6.7-like cgroup attribution.
Refs:
https://linear.app/codercom/issue/PLAT-637