RFR: JDK-8293472: Potentially incorrect container resource limit detection if manual cgroup fs mounts present [v4]

王超 duke at openjdk.org
Thu Sep 8 03:32:48 UTC 2022


On Wed, 7 Sep 2022 09:56:00 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:

> 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.

Thank you very much for the reviewing. I have not noticed JDK-8270087 before, sorry about filing a duplicate jdk bug.

> My testing on cgv2 and cgv1 indicates that we might have a container resource limit detection problem depending on the order of `mountinfo` entries are observed at runtime. Please add memory and cpu limit container detection tests which do `-v /sys/fs/cgroup:/cgroups-in:ro` as a volume mount in addition. Thanks!

The `container resource limit detection problem` is also fixed when there are multiple cgroup fs mount entries, it is caused by multiple setting of root mount path in function `CgroupSubsystemFactory::determine_type`.

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

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


More information about the hotspot-runtime-dev mailing list