JDK-8227317 : [TESTBUG] jdk docker/TestDockerMemoryMetrics.java fails on systems w/o kernel memory accounting
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 11,13,14
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-07-05
  • Updated: 2024-01-03
  • Resolved: 2019-10-24
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 14
11.0.22-oracleFixed 14 b21Fixed
Related Reports
Relates :  
Relates :  
Sub Tasks
JDK-8229032 :  
Description
Test fails on OL/RHEL when using Docker version 18.09:

docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused \\"process_linux.go:367: setting cgroup config for procHooks process caused \\\\\\"kernel memory accounting disabled in this runc build\\\\\\"\\"": unknown.

https://github.com/opencontainers/runc/commit/6a2c1559684

"Kernel memory accounting is known to be broken in some kernels,
specifically the ones from RHEL7 (including RHEL 7.5). Those
kernels do not support kernel memory reclaim, and are prone to
oopses. Unconditionally enabling kmem acct on such kernels lead
to bugs"
Comments
[11u-na] The test case fixed by this change was removed when backporting JDK-8275735: [linux] Remove deprecated Metrics api (kernel memory limit)
03-01-2024

Commit: https://github.com/openjdk/jdk/commit/cd4d0bc498c922b48b3b76c52c033a1b1eb6ba03 Author: Mikhailo Seledtsov <mseledtsov@openjdk.org> Date: Thu Oct 24 12:18:32 2019 -0700
29-11-2023

URL: https://hg.openjdk.java.net/jdk/jdk/rev/5a9dba5a3eeb User: mseledtsov Date: 2019-10-24 19:19:14 +0000
24-10-2019

Webrev: http://cr.openjdk.java.net/~mseledtsov/8227317.01/ Testing: 1. Ran the test on systems with disabled kernel memory accounting before and after the fix. 2. Ran the test case 60 times on multiple Linux-x64 systems - no failures
22-10-2019

ILW = MMM = P3
15-10-2019

Thank you Bob for this recommendation, I will follow it. I will probably throw "jtreg.SkippedException" instead of passing, so that the test result is recorded as "Skipped"
02-08-2019

Looks like one solution here is to check both Docker Engine version and the Kernel version, and exclude this test if (dockerVersion >=18.x && Linux.isBasedOn(RHEL 7.x)). I presume OL 7.* has this issue as well. Looks like this can be handled in a test. Also, consider printing Container Engine version in the test logs, for future diagnostic needs.
01-08-2019

I would prefer having the test check for the "kernel memory accounting disabled" message and reporting success if this occurs. This allows the tests to pass on any kernel that isn't properly configured.
01-08-2019