RFR: 8272124: Cgroup v1 initialization causes NullPointerException when cgroup path contains colon [v2]
Severin Gehwolf
sgehwolf at openjdk.java.net
Wed Aug 18 12:49:26 UTC 2021
On Tue, 17 Aug 2021 17:46:29 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:
>> Harold Seigel has updated the pull request incrementally with one additional commit since the last revision:
>>
>> add test case, comments, and other small changes
>
> test/jdk/jdk/internal/platform/cgroup/TestCgroupSubsystemFactory.java line 375:
>
>> 373: CgroupInfo memoryInfo = res.getInfos().get("memory");
>> 374: assertEquals(memoryInfo.getCgroupPath(), "/system.slice/containerd.service/kubepods-burstable-podf65e797d_d5f9_4604_9773_94f4bb9946a0.slice:cri-containerd:86ac6260f9f8a9c1276748250f330ae9c2fcefe5ae809364ad1e45f3edf7e08a");
>> 375: assertEquals(memoryInfo.getMountRoot(), memoryInfo.getMountRoot());
>
> What I meant here is to also change the mountinfo entry for `memory` and then use
>
> assertEquals(memoryInfo.getMountRoot(), memoryInfo.getCgroupPath());
>
> as that's really what was happening in the wild. mount root - containing colons - would correctly parse, but the cgroup path - containing colons - would not and the assertion would fail (without the change in CgroupSubsystemFactory). Thanks!
@hseigel it still has `assertEquals(memoryInfo.getMountRoot(), memoryInfo.getMountRoot());` - tautology - should be: `assertEquals(memoryInfo.getMountRoot(), memoryInfo.getCgroupPath());`
-------------
PR: https://git.openjdk.java.net/jdk/pull/5127
More information about the core-libs-dev
mailing list