moby / moby/moby

Improve handling of hybrid v1/v2 cgroups

Open
#50,123 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/feature status/0-triage
Dominant language
Go
Stars
72.1k
Forks
19.2k
Avg merge
1d 17h
Merged PRs (30d)
164

Description

Description

related:

The daemon currently accounts for the host to be either cgroup v1 or v2, but doesn't properly handle situations where the host is running hybrid v1/v2.
https://github.com/moby/moby/blob/829b6953756f1ad21769f318ec9717ed854936b3/pkg/sysinfo/sysinfo_linux.go#L88-L95

On hosts where (some) ome v1 controllers are in use (hierarchy != 0), resulting in the daemon failing to start;

failed to start daemon: Devices cgroup isn't mounted

On such hosts;

 cat bad/proc-cgroups.utf8
#subsys_name    hierarchy       num_cgroups     enabled
cpuset  0       57      1
cpu     2       4       1   <- this
cpuacct 0       57      1
blkio   0       57      1
memory  1       4       1   <- this
devices 0       57      1
freezer 0       57      1
net_cls 0       57      1
perf_event      0       57      1
net_prio        0       57      1
hugetlb 0       57      1
pids    0       57      1
rdma    0       57      1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with pkg/sysinfo/sysinfo_linux.go around lines 88-95 and compare its cgroup detection with the provided hybrid /proc/cgroups output. Reproduce the daemon startup failure on a host using v1 and v2 controllers, then verify that hybrid cgroup hosts no longer fail with “Devices cgroup isn't mounted”.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, linux
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.