Skip to content

fix(cgroup): filter name=* subsystems on cgroupv1#1045

Merged
aymericDD merged 1 commit intomainfrom
aymeric.daurelle/CHAOSPLT-1542/fix
Feb 26, 2026
Merged

fix(cgroup): filter name=* subsystems on cgroupv1#1045
aymericDD merged 1 commit intomainfrom
aymeric.daurelle/CHAOSPLT-1542/fix

Conversation

@aymericDD
Copy link
Contributor

@aymericDD aymericDD commented Feb 26, 2026

What does this PR do?

  • Fixes a bug

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.

The regression was introduced in #704, which created cgroup/manager_linux.go and the initial newAllCGroupManager implementation that reads all subsystems from /proc/PID/cgroup without filtering named hierarchy entries.

The following disruptions were impacted on cgroupv1 systems and are now fixed:

  • CPU Stress: injection completely failed — Join(pid)EnterPid() would error on the invalid name=systemd path
  • Disk Pressure: Write("blkio", ...) throttle settings could fail
  • Network Disruption: Write("net_cls", ...) classid assignment could fail
  • CPU Pressure: ReadCPUSet() could be affected

Code Quality Checklist

  • The documentation is up to date.
  • My code is sufficiently commented and passes continuous integration checks.
  • I have signed my commit (see Contributing Docs).

Testing

  • I leveraged continuous integration testing
    • by depending on existing unit tests or end-to-end tests.
    • by adding new unit tests or end-to-end tests.
  • I manually tested the following steps:
    • Verified EnterPid no longer fails on cgroupv1 systems with name=systemd entries.
    • locally.
    • as a canary deployment to a cluster.

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.
@aymericDD aymericDD marked this pull request as ready for review February 26, 2026 10:35
@aymericDD aymericDD requested a review from a team as a code owner February 26, 2026 10:35
@datadog-datadog-prod-us1-2
Copy link

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 39.29% (+0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 1355b86 | Docs | Datadog PR Page | Was this helpful? Give us feedback!

@aymericDD aymericDD merged commit 7dd0bf0 into main Feb 26, 2026
13 checks passed
@aymericDD aymericDD deleted the aymeric.daurelle/CHAOSPLT-1542/fix branch February 26, 2026 10:57
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