From f7af599289bfd7f81d9dde12ca148d66346a605d Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Mon, 6 Feb 2023 11:58:42 -0800 Subject: [PATCH] Revert "[memorylimiter] Fix cgroups parsing (#6825)" (#7142) This reverts commit ede9e0a15588b0ca3f85c3cf8a1b8eb7e739315f. --- .chloggen/fix-memory-limiter.yaml | 16 ---------------- internal/cgroups/cgroups.go | 4 +--- internal/cgroups/testdata/proc/cgroups/mountinfo | 2 -- 3 files changed, 1 insertion(+), 21 deletions(-) delete mode 100755 .chloggen/fix-memory-limiter.yaml diff --git a/.chloggen/fix-memory-limiter.yaml b/.chloggen/fix-memory-limiter.yaml deleted file mode 100755 index 3254fa7e34d..00000000000 --- a/.chloggen/fix-memory-limiter.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' -change_type: bug_fix - -# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) -component: memorylimiterprocessor - -# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: "Fix incorrect parsing of cgroups when running Collector with host mount" - -# One or more tracking issues or pull requests related to the change -issues: [6826] - -# (Optional) One or more lines of additional information to render under the primary note. -# These lines will be padded with 2 spaces and then inserted directly into the document. -# Use pipe (|) for multiline entries. -subtext: diff --git a/internal/cgroups/cgroups.go b/internal/cgroups/cgroups.go index 37eaaacc0b7..ed9e46104ae 100644 --- a/internal/cgroups/cgroups.go +++ b/internal/cgroups/cgroups.go @@ -104,9 +104,7 @@ func NewCGroups(procPathMountInfo, procPathCGroup string) (CGroups, error) { if err != nil { return err } - if strings.HasPrefix(cgroupPath, "/sys") { - cgroups[opt] = NewCGroup(cgroupPath) - } + cgroups[opt] = NewCGroup(cgroupPath) } return nil diff --git a/internal/cgroups/testdata/proc/cgroups/mountinfo b/internal/cgroups/testdata/proc/cgroups/mountinfo index a3caa8b760b..e68af08a576 100644 --- a/internal/cgroups/testdata/proc/cgroups/mountinfo +++ b/internal/cgroups/testdata/proc/cgroups/mountinfo @@ -6,5 +6,3 @@ 6 5 0:5 / /sys/fs/cgroup/cpuset rw,nosuid,nodev,noexec,relatime shared:6 - cgroup cgroup rw,cpuset 7 5 0:6 /docker /sys/fs/cgroup/cpu,cpuacct rw,nosuid,nodev,noexec,relatime shared:7 - cgroup cgroup rw,cpu,cpuacct 8 5 0:7 /docker /sys/fs/cgroup/memory rw,nosuid,nodev,noexec,relatime shared:8 - cgroup cgroup rw,memory -9 1 0:8 / /var/lib/docker/overlay2/9054a95f2cf7296867089e1bd37931742a17eb3308a795d51adb2654ee2276df/merged/sys/fs/cgroup ro,nosuid,nodev,noexec,relatime - tmpfs tmpfs rw,mode=755 -10 9 0:9 /docker /var/lib/docker/overlay2/9054a95f2cf7296867089e1bd37931742a17eb3308a795d51adb2654ee2276df/merged/sys/fs/cgroup/memory ro,nosuid,nodev,noexec,relatime master:17 - cgroup cgroup rw,memory