-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
Describe the bug
We started to see some strange test failures in our CI after #18085, where JDK 24 was introduced. AdmissionControlSingleNodeTests.testAdmissionControlRejectionMonitorOnlyMode and AdmissionControlSingleNodeTests.testAdmissionControlRejectionEnforcedMode specifically.
Those test expect requests to be rejected with a failure based on some CPU-load based policies, but that didn't happen for some reason. After spending some time I found that AverageCpuUsageTracker.getAverage started returning -1 in our CI.
Digging deeper I found that the cause is indeed in the security.policy (similar to #18548).
So with JDK 24 these permissions are now required as well:
permission java.io.FilePermission "/sys/fs/cgroup/cpu.max", "read";
permission java.io.FilePermission "/sys/fs/cgroup/cpu.weight", "read";
permission java.io.FilePermission "/sys/fs/cgroup/cpuset.cpus", "read";
permission java.io.FilePermission "/sys/fs/cgroup/cpuset.cpus.effective", "read";
I'can tell which exactly systems might be affected as I wasn't able to reproduce on my macOS and build.ci.opensearch.org doesn't have these failures.
These are the stack traces to prove my point:
- https://gist.github.com/Mishail/3cfe66d357d7be45278af948837bcb36
- https://gist.github.com/Mishail/dc22658c295daad9935d0558e55f465a
- https://gist.github.com/Mishail/81aee4e8805e1c434a576d37c957c28b
- https://gist.github.com/Mishail/b3ae3365729f378f5df5df629abdaad4
- https://gist.github.com/Mishail/dcaec18dd447c12c4241a033da345b70
Related component
Build
To Reproduce
Run ./gradlew test on a system that uses CgroupV2Subsystem implementation of CgroupSubsystem
Expected behavior
Tests pass
Additional Details
No response