Add hack for Docker cgroups#22757
Conversation
|
Also, I should point out that I built a new Docker image from a SNAPSHOT build of Elasticsearch with this fix, and I was able to obtain the expected cgroup stats. |
Docker cgroups are mounted in the wrong place (i.e., inconsistently with /proc/self/cgroup). This commit adds an undocumented hack for working around, for now.
b77482e to
1401bef
Compare
rjernst
left a comment
There was a problem hiding this comment.
Looks good, a few minor comments.
There was a problem hiding this comment.
should this be "not mounting...consistently" or "mounting...inconsistently"? But I would think not the current double negative.
There was a problem hiding this comment.
Yes, I'll fix in the morning before merging.
There was a problem hiding this comment.
This can just be System.getProperty? I thought the point of BootstrapInfo.getSystemProperties() was when you wanted to call System.getProperties() (which we have in forbidden apis)
There was a problem hiding this comment.
You're right, I'll change.
This commit cleans up a few issues with the cgroups hierarchy hack: - renames the property from es.cgroups.path.override to es.cgroups.hierarchy.override - fixes a double negative in a comment - just uses System#getProperty instead of BootstrapInfo#getSystemProperties
|
@elasticmachine test this please |
thanks for verifying. it's hard to test I guess... I wonder if we should port this to 5.1.x - but I might be mistaking that this exists already in 5.1.x.. not sure |
+1, I'll port to 5.1 as well (you're not mistaken). |
|
retest this please |
Docker cgroups are mounted in the wrong place (i.e., inconsistently with /proc/self/cgroup). This commit adds an undocumented hack for working around, for now. Relates #22757
Docker cgroups are mounted in the wrong place (i.e., inconsistently with /proc/self/cgroup). This commit adds an undocumented hack for working around, for now. Relates #22757
Docker cgroups are mounted in the wrong place (i.e., inconsistently with /proc/self/cgroup). This commit adds an undocumented hack for working around, for now. Relates #22757
| controllerMap.put(controller, matcher.group(2)); | ||
| if (CONTROL_GROUPS_HIERARCHY_OVERRIDE != null) { | ||
| /* | ||
| * Docker violates the relationship between /proc/self/cgroups and the /sys/fs/cgroup hierarchy. It's possible that this |
There was a problem hiding this comment.
@jasontedor Very minor typo, but should be /proc/self/cgroup
Docker mounts cgroup stats inconsistently with the hierarchy in /proc/self/cgroup. This breaks the logic for traversing from /proc/self/cgroup to the stats for a process running inside a container. In core Elasticsearch, an undocumented hack was added to support this, for now. Thus, for cgroup stats to be available from Elasticsearch running inside a Docker container, the Elasticsearch process should be started with `-Des.cgroups.hierarchy.override=/`. Add hack for obtaining cgroup stats and comment it. Relates #25 Relates elastic/elasticsearch#22757
Docker mounts cgroup stats inconsistently with the hierarchy in /proc/self/cgroup. This breaks the logic for traversing from /proc/self/cgroup to the stats for a process running inside a container. In core Elasticsearch, an undocumented hack was added to support this, for now. Thus, for cgroup stats to be available from Elasticsearch running inside a Docker container, the Elasticsearch process should be started with `-Des.cgroups.hierarchy.override=/`. Add hack for obtaining cgroup stats and comment it. Relates #25 Relates elastic/elasticsearch#22757
Docker mounts cgroup stats inconsistently with the hierarchy in /proc/self/cgroup. This breaks the logic for traversing from /proc/self/cgroup to the stats for a process running inside a container. In core Elasticsearch, an undocumented hack was added to support this, for now. Thus, for cgroup stats to be available from Elasticsearch running inside a Docker container, the Elasticsearch process should be started with `-Des.cgroups.hierarchy.override=/`. Add hack for obtaining cgroup stats and comment it. Relates #25 Relates elastic/elasticsearch#22757
Docker cgroups are mounted in the wrong place (i.e., inconsistently with /proc/self/cgroup). This commit adds an undocumented hack for working around, for now.
Relates #21029