Browse Source

fix(cgroups.plugin): remove "search for cgroups under PATH" conf option to fix memory leak (#12752)

Ilya Mashchenko 2 years ago
parent
commit
5e8b714acc
2 changed files with 1 additions and 16 deletions
  1. 0 7
      collectors/cgroups.plugin/README.md
  2. 1 9
      collectors/cgroups.plugin/sys_fs_cgroup.c

+ 0 - 7
collectors/cgroups.plugin/README.md

@@ -45,13 +45,6 @@ Netdata rescans these directories for added or removed cgroups every `check for
 
 Since cgroups are hierarchical, for each of the directories shown above, Netdata walks through the subdirectories recursively searching for cgroups (each subdirectory is another cgroup).
 
-For each of the directories found, Netdata provides a configuration variable:
-
-```
-[plugin:cgroups]
-	search for cgroups under PATH = yes | no
-```
-
 To provide a sane default for this setting, Netdata uses the following pattern list (patterns starting with `!` give a negative match and their order is important: the first matching a path will be used):
 
 ```

+ 1 - 9
collectors/cgroups.plugin/sys_fs_cgroup.c

@@ -1964,15 +1964,7 @@ static inline int find_dir_in_subdirs(const char *base, const char *this, void (
                 if(*r == '\0') r = "/";
 
                 // do not decent in directories we are not interested
-                int def = simple_pattern_matches(enabled_cgroup_paths, r);
-
-                // we check for this option here
-                // so that the config will not have settings
-                // for leaf directories
-                char option[FILENAME_MAX + 1];
-                snprintfz(option, FILENAME_MAX, "search for cgroups under %s", r);
-                option[FILENAME_MAX] = '\0';
-                enabled = config_get_boolean("plugin:cgroups", option, def);
+                enabled = simple_pattern_matches(enabled_cgroup_paths, r);
             }
 
             if(enabled) {