Skip to content

fix: handle busy cgroup mounts on Bottlerocket - #181

Merged
geokat merged 3 commits into
mainfrom
george/plat-637/regression-in-068-on-bottlerocket
Sep 15, 2026
Merged

geokat merged 3 commits into
mainfrom
george/plat-637/regression-in-068-on-bottlerocket

Conversation

@geokat

@geokat geokat commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

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

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
@linear-code

linear-code Bot commented Sep 14, 2026

Copy link
Copy Markdown

PLAT-637

@geokat
geokat marked this pull request as ready for review September 14, 2026 23:07
Comment thread cli/wrap_dockerd.sh Outdated
Comment thread cli/wrap_dockerd.sh
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 BobbyHo left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@geokat

geokat commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

Testing the fallback path on EKS showed that skipping the /init and subtree-control setup was not enough to restore functionality.
665ecdd re-enters the parent cgroup namespace as a fallback, restoring the namespace/mount alignment and resulting in 0.6.7-like behavior.

@geokat
geokat merged commit 2045655 into main Sep 15, 2026
13 checks passed
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

Successfully merging this pull request may close these issues.

2 participants