RFR: JDK-8293472: Cgroup: 'stomping of _mount_path' crash if manually mounted cg controller exist [v4]

Severin Gehwolf sgehwolf at openjdk.org
Wed Sep 7 09:59:44 UTC 2022


On Wed, 7 Sep 2022 09:16:52 GMT, 王超 <duke at openjdk.org> wrote:

>> Similar to [JDK-8253435](https://bugs.openjdk.org/browse/JDK-8253435), when setting the mount path of cgroup controller "memory/cpu/cpuacct/pids", it should also discard duplicate items.
>
> 王超 has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Fix typo

Looks mostly good. https://bugs.openjdk.org/browse/JDK-8270087 seems to be an early sighting of this. It mentions a reproducer, manually mount `/sys/fs/cgroup` from the host into the container. Please write a container test asserting that no warnings get produced. Perhaps use `test/hotspot/jtreg/containers/docker/DockerBasicTest.java` and write a new test method `javaVersionWithCgMounts` or some such, which verifies no warning shows up on stdout.

src/hotspot/os/linux/cgroupSubsystem_linux.cpp line 136:

> 134:     if (strstr(cg_infos[controller]._mount_path, "/sys/fs/cgroup") != cg_infos[controller]._mount_path) {
> 135:       log_warning(os, container)("Duplicate %s controllers detected. Picking %s, skipping %s.",
> 136:                                  name, mount_path, cg_infos[controller]._mount_path);

Please demote this to `log_debug` over a `log_warning`.

src/hotspot/os/linux/cgroupSubsystem_linux.cpp line 141:

> 139:     } else {
> 140:       log_warning(os, container)("Duplicate %s controllers detected. Picking %s, skipping %s.",
> 141:                                  name, cg_infos[controller]._mount_path, mount_path);

Please demote this to `log_debug` over `log_warning`.

-------------

Changes requested by sgehwolf (Reviewer).

PR: https://git.openjdk.org/jdk/pull/10193


More information about the hotspot-runtime-dev mailing list