[jdk8u-dev] RFR: 8245543: Cgroups: Incorrect detection logic on some systems (still reproducible)
Severin Gehwolf
sgehwolf at openjdk.org
Fri Nov 11 15:43:48 UTC 2022
On Mon, 7 Nov 2022 10:30:16 GMT, Jonathan Dowland <jdowland at openjdk.org> wrote:
> A backport of 8245543 to jdk8u-dev for cgroups v2 support.
>
> Not clean: needed minor adjusting for 8u approach to log output.
Tests will need adjustment for this one.
hotspot/test/runtime/containers/cgroup/CgroupSubsystemFactory.java line 178:
> 176:
> 177: cgroupv1MntInfoSystemdOnly = Paths.get(existingDirectory.toString(), "mnt_info_cgroupv1_systemd_only");
> 178: Files.writeString(cgroupv1MntInfoSystemdOnly, mntInfoCgroupsV1SystemdOnly);
`s/Files.writeString/Files.write`
jdk/test/jdk/internal/platform/cgroup/TestCgroupSubsystemFactory.java line 127:
> 125:
> 126: cgroupv1MntInfoSystemdOnly = Paths.get(existingDirectory.toString(), "mountinfo_cgroupv1_systemd_only");
> 127: Files.writeString(cgroupv1MntInfoSystemdOnly, mntInfoCgroupsV1SystemdOnly);
Same here. Adjust to 8u API (`Files.writeString` not available).
jdk/test/jdk/internal/platform/cgroup/TestCgroupSubsystemFactory.java line 148:
> 146: Optional<CgroupTypeResult> result = CgroupSubsystemFactory.determineType(mountInfo, cgroups);
> 147:
> 148: assertTrue("zero hierarchy ids with no *relevant* controllers mounted", result.isEmpty());
`Optional.isEmpty()` not available in 8u.
-------------
Changes requested by sgehwolf (Reviewer).
PR: https://git.openjdk.org/jdk8u-dev/pull/159
More information about the jdk8u-dev
mailing list