JDK-8294740 : Add cgroups keyword to TestDockerBasic.java
  • Type: Bug
  • Component: core-svc
  • Affected Version: 20
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-10-03
  • Updated: 2022-12-01
  • Resolved: 2022-10-04
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 17 JDK 20
11.0.18Fixed 17.0.6Fixed 20 b18Fixed
Related Reports
Relates :  
Relates :  
Description
test/jdk/jdk/internal/platform/docker/TestDockerBasic.java fails with

[Error: OCI runtime error: runc: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: process_linux.go:508: setting cgroup config for procHooks process caused: cannot set memory limit: container could not join or create cgroup

This happens on OL8 not OL7. This started with the integration of JDK-8293540.

This test uses cgroups features but is missing the "@key cgroups" line. See JDK-8255787
Comments
Fix Request (OpenJDK 11u): Follow up, test-only fix for JDK-8293540. Should be very little risk as it's only touching a comment in a test.
17-11-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk11u-dev/pull/1527 Date: 2022-11-17 14:33:34 +0000
17-11-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk17u-dev/pull/795 Date: 2022-10-14 14:03:36 +0000
14-10-2022

Fix Request (OpenJDK 17u): Follow up, test-only fix for JDK-8293540. Should be very little risk as it's only touching a comment in a test.
14-10-2022

Changeset: ae79af2a Author: Ioi Lam <iklam@openjdk.org> Date: 2022-10-04 03:21:10 +0000 URL: https://git.openjdk.org/jdk/commit/ae79af2ad67b51a7608f4c9060421dd175cabf3f
04-10-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/10547 Date: 2022-10-04 01:03:25 +0000
04-10-2022

Failure here. Apparently our runtime does not allow the combination of the following in the command-line --memory 300m --volume /sys/fs/cgroup:/cgroup-in:ro https://github.com/openjdk/jdk/blob/07ed68efb2e9758732787447fb0339d0899be884/test/jdk/jdk/internal/platform/docker/TestDockerBasic.java#L56-L71 private static void testXshowSettingsSystem(boolean addCgroupMounts) throws Exception { String testMsg = (addCgroupMounts ? " with " : " without ") + " additional cgroup FS mounts in /cgroup-in"; Common.logNewTestCase("Test TestDockerBasic " + testMsg); DockerRunOptions opts = new DockerRunOptions(imageName, "/jdk/bin/java", "-version"); opts.addJavaOpts("-esa"); opts.addJavaOpts("-XshowSettings:system"); opts.addDockerOpts("--memory", "300m"); if (addCgroupMounts) { // Extra cgroup mount should be ignored by product code opts.addDockerOpts("--volume", "/sys/fs/cgroup:/cgroup-in:ro"); } DockerTestUtils.dockerRunJava(opts).shouldHaveExitValue(0) <<<< LINE 68 .shouldNotContain("AssertionError") .shouldContain("Memory Limit: 300.00M"); } } ----------System.err:(17/1035)---------- stdout: []; stderr: [Error: OCI runtime error: runc: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: process_linux.go:508: setting cgroup config for procHooks process caused: cannot set memory limit: container could not join or create cgroup ] exitValue = 126 java.lang.RuntimeException: Expected to get exit value of [0], exit value is: [126] at jdk.test.lib.process.OutputAnalyzer.shouldHaveExitValue(OutputAnalyzer.java:490) at TestDockerBasic.testXshowSettingsSystem(TestDockerBasic.java:68) at TestDockerBasic.main(TestDockerBasic.java:49) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) at java.base/java.lang.reflect.Method.invoke(Method.java:578) at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:312) at java.base/java.lang.Thread.run(Thread.java:1588)
04-10-2022