Skip to content

hack/dind: fix cgroup v2 evacuation with docker run --init#42331

Merged
thaJeztah merged 1 commit into
moby:masterfrom
AkihiroSuda:dind-fix-cgroup2-evac
Apr 30, 2021
Merged

hack/dind: fix cgroup v2 evacuation with docker run --init#42331
thaJeztah merged 1 commit into
moby:masterfrom
AkihiroSuda:dind-fix-cgroup2-evac

Conversation

@AkihiroSuda

Copy link
Copy Markdown
Member

- What I did

Fix docker-library/docker#308

- How I did it
Evacuate all the processes in /sys/fs/cgroup/cgroup.procs, not just PID 1.

- How to verify it

Before:

$ docker run --rm --privileged --init $(docker build -q .) cat /sys/fs/cgroup/cgroup.subtree_control
sed: couldn't flush stdout: Device or resource busy

After:

$ docker run --rm --privileged --init $(docker build -q .) cat /sys/fs/cgroup/cgroup.subtree_control
cpuset cpu io memory hugetlb pids rdma

Comment thread hack/dind Outdated
Evacuate all the processes in `/sys/fs/cgroup/cgroup.procs`, not just PID 1.

Before:
```console
$ docker run --rm --privileged --init $(docker build -q .) cat /sys/fs/cgroup/cgroup.subtree_control
sed: couldn't flush stdout: Device or resource busy
```

After:
```console
$ docker run --rm --privileged --init $(docker build -q .) cat /sys/fs/cgroup/cgroup.subtree_control
cpuset cpu io memory hugetlb pids rdma
```

Fix docker-library/docker issue 308

Signed-off-by: Akihiro Suda <[email protected]>
@AkihiroSuda
AkihiroSuda force-pushed the dind-fix-cgroup2-evac branch from b521923 to 42b1175 Compare April 28, 2021 04:30

@tianon tianon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! Thanks for looking into this and figuring out a fix 💪😎

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@thaJeztah thaJeztah added this to the 21.xx milestone Apr 30, 2021
@thaJeztah

Copy link
Copy Markdown
Member

Failures are unrelated; this one is interesting though (on Windows RS5); hopefully just a hiccup

[2021-04-28T09:36:18.557Z] go: downloading gotest.tools/gotestsum v0.5.3
[2021-04-28T09:36:18.557Z] verifying gotest.tools/[email protected]: gotest.tools/[email protected]: Get https://sum.golang.org/lookup/gotest.tools/[email protected]: x509: certificate signed by unknown authority

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cgroup v2 error - "sed: write error"

3 participants