fix(cgroup): filter name=* subsystems on cgroupv1#1045
Merged
Conversation
On cgroupv1, /proc/PID/cgroup contains a "name=systemd" named hierarchy. Using this key as a mount directory name produces an invalid path (/sys/fs/cgroup/name=systemd/...) that doesn't exist on disk, causing EnterPid to fail before any resource controller is joined. Filter name=* entries at construction time in newAllCGroupManager so only real resource controllers reach EnterPid.
Zenithar
approved these changes
Feb 26, 2026
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: 1355b86 | Docs | Datadog PR Page | Was this helpful? Give us feedback! |
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.
What does this PR do?
On cgroupv1,
/proc/PID/cgroupcontains aname=systemdnamed hierarchy. Using this key as a mount directory name produces an invalid path (/sys/fs/cgroup/name=systemd/...) that doesn't exist on disk, causingEnterPidto fail before any resource controller is joined.Filter
name=*entries at construction time innewAllCGroupManagerso only real resource controllers reachEnterPid.The regression was introduced in #704, which created
cgroup/manager_linux.goand the initialnewAllCGroupManagerimplementation that reads all subsystems from/proc/PID/cgroupwithout filtering named hierarchy entries.The following disruptions were impacted on cgroupv1 systems and are now fixed:
Join(pid)→EnterPid()would error on the invalidname=systemdpathWrite("blkio", ...)throttle settings could failWrite("net_cls", ...)classid assignment could failReadCPUSet()could be affectedCode Quality Checklist
Testing
unittests orend-to-endtests.unittests orend-to-endtests.EnterPidno longer fails on cgroupv1 systems withname=systemdentries.