JDK-8340092 : [Linux] containers/systemd/SystemdMemoryAwarenessTest.java failing on some systems
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 24
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: generic
  • Submitted: 2024-09-13
  • Updated: 2024-09-30
  • Resolved: 2024-09-20
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 24
24 b17Fixed
Related Reports
Relates :  
Description
We see containers/systemd/SystemdMemoryAwarenessTest.java failing on an system with Linux Ubuntu 22.04 (Linux x86_64) and one another with Linux RHEL 9.3 (ppc64le).
stdout
DEBUG: Running test with a CPU limit of 1
stderr
java.nio.file.FileAlreadyExistsException: /<ourhomedir>/.config/systemd/user/jdk_internal.slice.d
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:94)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
at java.base/sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:446)
at java.base/java.nio.file.Files.createDirectory(Files.java:700)
at jdk.test.lib.containers.systemd.SystemdTestUtils.buildSystemdSlices(SystemdTestUtils.java:138)
at jdk.test.lib.containers.systemd.SystemdTestUtils.buildAndRunSystemdJava(SystemdTestUtils.java:90)
at SystemdMemoryAwarenessTest.testHelloSystemd(SystemdMemoryAwarenessTest.java:69)
at SystemdMemoryAwarenessTest.main(SystemdMemoryAwarenessTest.java:48)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:573)
at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
at java.base/java.lang.Thread.run(Thread.java:1576)

The test was introduced with JDK-8333446
Comments
Changeset: 64275e6b Branch: master Author: Severin Gehwolf <sgehwolf@openjdk.org> Date: 2024-09-20 19:34:24 +0000 URL: https://git.openjdk.org/jdk/commit/64275e6bbf1377c9a9d77fe3c3ed8d4143138f11
20-09-2024

There is another issue, which seems related to the configured system. When 'systemctl --user status', for example, fails, then the test might fail with: ----------System.out:(12/438)---------- DEBUG: Running test with a CPU limit of 1 [COMMAND] systemctl --user daemon-reload [2024-09-15T17:49:18.085450384Z] Gathering output for process 64484 [STDERR] Failed to connect to bus: Connection refused [STDOUT] Full child process STDOUT was saved to systemd-stdout-64484.log [2024-09-15T17:49:18.280798148Z] Waiting for completion for process 64484 [2024-09-15T17:49:18.280935948Z] Waiting for completion finished for process 64484 ----------System.err:(15/1052)---------- java.lang.AssertionError: Failed to reload systemd daemon at jdk.test.lib.containers.systemd.SystemdTestUtils.systemdDaemonReload(SystemdTestUtils.java:190) at jdk.test.lib.containers.systemd.SystemdTestUtils.buildSystemdSlices(SystemdTestUtils.java:169) at jdk.test.lib.containers.systemd.SystemdTestUtils.buildAndRunSystemdJava(SystemdTestUtils.java:91) at SystemdMemoryAwarenessTest.testHelloSystemd(SystemdMemoryAwarenessTest.java:69) at SystemdMemoryAwarenessTest.main(SystemdMemoryAwarenessTest.java:48) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:573) at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138) at java.base/java.lang.Thread.run(Thread.java:1576) The test appropriately runs when `systemctl --user status` works (exits with 0): [COMMAND] systemd-run --user --slice jdk_internal-SystemdMemoryAwarenessTestHS-cpu.slice --scope /home/sgehwolf/jdk-jdk/../jdk24-jdk-metrics/bin/java -Xlog:os+container=trace -cp /home/sgehwolf/jdk-jdk/JTwork/classes/containers/systemd/SystemdMemoryAwarenessTest.d HelloSystemd [2024-09-16T14:04:31.003456138Z] Gathering output for process 7396 [STDERR] Running scope as unit: run-r08cdb13b017f42bf92f3a4e096a25870.scope [STDOUT] [0.000s][trace][os,container] OSContainer::init: Initializing Container Support [0.000s][debug][os,container] Detected optional pids controller entry in /proc/cgroups [0.001s][debug][os,container] Detected cgroups v2 unified hierarchy [0.001s][trace][os,container] Adjusting controller path for memory: /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/jdk_internal.slice/jdk_internal-SystemdMemoryAwarenessTestHS.slice/jdk_internal-SystemdMemoryAwarenessTestHS-cpu.slice/run-r08cdb13b017f42bf92f3a4e096a25870.scope [0.001s][trace][os,container] Path to /memory.max is /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/jdk_internal.slice/jdk_internal-SystemdMemoryAwarenessTestHS.slice/jdk_internal-SystemdMemoryAwarenessTestHS-cpu.slice/run-r08cdb13b017f42bf92f3a4e096a25870.scope/memory.max [0.001s][trace][os,container] Memory Limit is: -1 [0.001s][trace][os,container] Memory Limit is: Unlimited [0.001s][debug][os,container] container memory limit unlimited: -1, using host value 6207635456 [0.001s][trace][os,container] Path to /memory.max is /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/jdk_internal.slice/jdk_internal-SystemdMemoryAwarenessTestHS.slice/jdk_internal-SystemdMemoryAwarenessTestHS-cpu.slice/memory.max [0.001s][trace][os,container] Memory Limit is: -1 [0.001s][trace][os,container] Memory Limit is: Unlimited [0.001s][debug][os,container] container memory limit unlimited: -1, using host value 6207635456 [0.001s][trace][os,container] Path to /memory.max is /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/jdk_internal.slice/jdk_internal-SystemdMemoryAwarenessTestHS.slice/memory.max [0.001s][trace][os,container] Memory Limit is: 1073741824 [0.001s][trace][os,container] Memory Limit is: 1073741824 [0.001s][trace][os,container] Path to /memory.max is /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/jdk_internal.slice/memory.max [0.001s][trace][os,container] Memory Limit is: 536870912 [0.001s][trace][os,container] Memory Limit is: 536870912 [0.001s][trace][os,container] Path to /memory.max is /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/memory.max [0.001s][trace][os,container] Memory Limit is: -1 [0.001s][trace][os,container] Memory Limit is: Unlimited [0.001s][debug][os,container] container memory limit unlimited: -1, using host value 6207635456 [0.001s][trace][os,container] Path to /memory.max is /sys/fs/cgroup/user.slice/user-1000.slice/memory.max [0.001s][trace][os,container] Memory Limit is: -1 [0.001s][trace][os,container] Memory Limit is: Unlimited [0.001s][debug][os,container] container memory limit unlimited: -1, using host value 6207635456 [0.001s][trace][os,container] Path to /memory.max is /sys/fs/cgroup/user.slice/memory.max [0.001s][trace][os,container] Memory Limit is: -1 [0.001s][trace][os,container] Memory Limit is: Unlimited [0.001s][debug][os,container] container memory limit unlimited: -1, using host value 6207635456 [0.001s][trace][os,container] Path to /memory.max is /sys/fs/cgroup/memory.max [0.001s][debug][os,container] Open of file /sys/fs/cgroup/memory.max failed, No such file or directory [0.001s][trace][os,container] Memory Limit failed: -2 [0.001s][trace][os,container] Memory Limit is: -2 [0.001s][debug][os,container] container memory limit failed: -2, using host value 6207635456 [0.001s][trace][os,container] Adjusted controller path for memory to: /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/jdk_internal.slice. Lowest limit was: 536870912 [0.001s][trace][os,container] Adjusting controller path for cpu: /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/jdk_internal.slice/jdk_internal-SystemdMemoryAwarenessTestHS.slice/jdk_internal-SystemdMemoryAwarenessTestHS-cpu.slice/run-r08cdb13b017f42bf92f3a4e096a25870.scope [0.001s][trace][os,container] Path to /cpu.max is /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/jdk_internal.slice/jdk_internal-SystemdMemoryAwarenessTestHS.slice/jdk_internal-SystemdMemoryAwarenessTestHS-cpu.slice/run-r08cdb13b017f42bf92f3a4e096a25870.scope/cpu.max [0.001s][debug][os,container] Open of file /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/jdk_internal.slice/jdk_internal-SystemdMemoryAwarenessTestHS.slice/jdk_internal-SystemdMemoryAwarenessTestHS-cpu.slice/run-r08cdb13b017f42bf92f3a4e096a25870.scope/cpu.max failed, No such file or directory [0.001s][trace][os,container] Path to /cpu.max is /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/jdk_internal.slice/jdk_internal-SystemdMemoryAwarenessTestHS.slice/jdk_internal-SystemdMemoryAwarenessTestHS-cpu.slice/run-r08cdb13b017f42bf92f3a4e096a25870.scope/cpu.max [0.001s][debug][os,container] Open of file /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/jdk_internal.slice/jdk_internal-SystemdMemoryAwarenessTestHS.slice/jdk_internal-SystemdMemoryAwarenessTestHS-cpu.slice/run-r08cdb13b017f42bf92f3a4e096a25870.scope/cpu.max failed, No such file or directory [0.001s][trace][os,container] CPU Period failed: -2 [0.001s][trace][os,container] OSContainer::active_processor_count: 6 [0.001s][trace][os,container] Path to /cpu.max is /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/jdk_internal.slice/jdk_internal-SystemdMemoryAwarenessTestHS.slice/jdk_internal-SystemdMemoryAwarenessTestHS-cpu.slice/cpu.max [0.001s][trace][os,container] CPU Quota is: 100000 [0.001s][trace][os,container] Path to /cpu.max is /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/jdk_internal.slice/jdk_internal-SystemdMemoryAwarenessTestHS.slice/jdk_internal-SystemdMemoryAwarenessTestHS-cpu.slice/cpu.max [0.001s][trace][os,container] CPU Period is: 100000 [0.001s][trace][os,container] CPU Quota count based on quota/period: 1 [0.001s][trace][os,container] OSContainer::active_processor_count: 1 [0.001s][trace][os,container] Path to /cpu.max is /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/jdk_internal.slice/jdk_internal-SystemdMemoryAwarenessTestHS.slice/cpu.max [0.001s][trace][os,container] CPU Quota is: -1 [0.001s][trace][os,container] Path to /cpu.max is /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/jdk_internal.slice/jdk_internal-SystemdMemoryAwarenessTestHS.slice/cpu.max [0.001s][trace][os,container] CPU Period is: 100000 [0.001s][trace][os,container] OSContainer::active_processor_count: 6 [0.001s][trace][os,container] Path to /cpu.max is /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/jdk_internal.slice/cpu.max [0.001s][trace][os,container] CPU Quota is: -1 [0.001s][trace][os,container] Path to /cpu.max is /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/jdk_internal.slice/cpu.max [0.001s][trace][os,container] CPU Period is: 100000 [0.001s][trace][os,container] OSContainer::active_processor_count: 6 [0.001s][trace][os,container] Path to /cpu.max is /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/cpu.max [0.001s][trace][os,container] CPU Quota is: -1 [0.001s][trace][os,container] Path to /cpu.max is /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/cpu.max [0.001s][trace][os,container] CPU Period is: 100000 [0.001s][trace][os,container] OSContainer::active_processor_count: 6 [0.001s][trace][os,container] Path to /cpu.max is /sys/fs/cgroup/user.slice/user-1000.slice/cpu.max [0.001s][trace][os,container] CPU Quota is: -1 [0.001s][trace][os,container] Path to /cpu.max is /sys/fs/cgroup/user.slice/user-1000.slice/cpu.max [0.001s][trace][os,container] CPU Period is: 100000 [0.001s][trace][os,container] OSContainer::active_processor_count: 6 [0.001s][trace][os,container] Path to /cpu.max is /sys/fs/cgroup/user.slice/cpu.max [0.001s][trace][os,container] CPU Quota is: -1 [0.001s][trace][os,container] Path to /cpu.max is /sys/fs/cgroup/user.slice/cpu.max [0.001s][trace][os,container] CPU Period is: 100000 [0.001s][trace][os,container] OSContainer::active_processor_count: 6 [0.001s][trace][os,container] Path to /cpu.max is /sys/fs/cgroup/cpu.max [0.001s][debug][os,container] Open of file /sys/fs/cgroup/cpu.max failed, No such file or directory [0.001s][trace][os,container] Path to /cpu.max is /sys/fs/cgroup/cpu.max [0.001s][debug][os,container] Open of file /sys/fs/cgroup/cpu.max failed, No such file or directory [0.001s][trace][os,container] CPU Period failed: -2 [0.001s][trace][os,container] OSContainer::active_processor_count: 6 [0.001s][trace][os,container] Adjusted controller path for cpu to: /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/jdk_internal.slice/jdk_internal-SystemdMemoryAwarenessTestHS.slice/jdk_internal-SystemdMemoryAwarenessTestHS-cpu.slice. Lowest limit was: 1 [0.001s][trace][os,container] total physical memory: 6207635456 [0.001s][trace][os,container] Path to /memory.max is /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/jdk_internal.slice/memory.max [0.001s][trace][os,container] Memory Limit is: 536870912 [0.001s][trace][os,container] Memory Limit is: 536870912 [0.001s][debug][os,container] OSContainer::init: is_containerized() = true because either a cpu or a memory limit is present [0.001s][trace][os,container] Path to /cpu.max is /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/jdk_internal.slice/jdk_internal-SystemdMemoryAwarenessTestHS.slice/jdk_internal-SystemdMemoryAwarenessTestHS-cpu.slice/cpu.max [0.001s][trace][os,container] CPU Quota is: 100000 [0.001s][trace][os,container] Path to /cpu.max is /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/jdk_internal.slice/jdk_internal-SystemdMemoryAwarenessTestHS.slice/jdk_internal-SystemdMemoryAwarenessTestHS-cpu.slice/cpu.max [0.001s][trace][os,container] CPU Period is: 100000 [0.001s][trace][os,container] CPU Quota count based on quota/period: 1 [0.001s][trace][os,container] OSContainer::active_processor_count: 1 [0.001s][trace][os,container] CgroupSubsystem::active_processor_count (cached): 1 [0.002s][trace][os,container] CgroupSubsystem::active_processor_count (cached): 1 [0.053s][trace][os,container] Path to /cpu.max is /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/jdk_internal.slice/jdk_internal-SystemdMemoryAwarenessTestHS.slice/jdk_internal-SystemdMemoryAwarenessTestHS-cpu.slice/cpu.max [0.053s][trace][os,container] CPU Quota is: 100000 [0.053s][trace][os,container] Path to /cpu.max is /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/jdk_internal.slice/jdk_internal-SystemdMemoryAwarenessTestHS.slice/jdk_internal-SystemdMemoryAwarenessTestHS-cpu.slice/cpu.max [0.053s][trace][os,container] CPU Period is: 100000 [0.053s][trace][os,container] CPU Quota count based on quota/period: 1 [0.053s][trace][os,container] OSContainer::active_processor_count: 1
16-09-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/20989 Date: 2024-09-13 09:10:19 +0000
13-09-2024

Seems easy enough to reproduce. Create the directory ~/.config/systemd/user/jdk_internal.slice.d first before the test runs. FAILED: containers/systemd/SystemdMemoryAwarenessTest.java Test results: failed: 1 We should ignore existing directories and clobber existing files for these tests.
13-09-2024