Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-13306

CpuLoad metric return -1 under Java 11

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.8.1
    • Fix Version/s: 2.9
    • Component/s: None
    • Labels:
      None
    • Release Note:
      Added JVM option to support CPU load metric on java 11 and higher
    • Ignite Flags:
      Docs Required, Release Notes Required

      Description

      Start cluster under Java 11.

      Observed:
      CpuLoad metric will return -1

      Expected:
      Real CpuLoad.

      We investigated this issue and found that under Java 11 code failed with following trace:

      class org.apache.ignite.IgniteException: Failed to get property value [property=processCpuTime, obj=com.sun.management.internal.OperatingSystemImpl@1dd92fe2] at org.apache.ignite.internal.util.IgniteUtils.property(IgniteUtils.java:8306) at org.apache.ignite.internal.managers.discovery.GridDiscoveryManager$MetricsUpdater.getCpuLoad(GridDiscoveryManager.java:3131) at org.apache.ignite.internal.managers.discovery.GridDiscoveryManager$MetricsUpdater.run(GridDiscoveryManager.java:3093) at org.apache.ignite.internal.processors.timeout.GridTimeoutProcessor$CancelableTask.onTimeout(GridTimeoutProcessor.java:364) at org.apache.ignite.internal.processors.timeout.GridTimeoutProcessor$TimeoutWorker.body(GridTimeoutProcessor.java:233) at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:119) at java.base/java.lang.Thread.run(Thread.java:834) Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make public long com.sun.management.internal.OperatingSystemImpl.getProcessCpuTime() accessible: module jdk.management does not "opens com.sun.management.internal" to unnamed module @35fb3008 at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:340) at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:280) at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:198) at java.base/java.lang.reflect.Method.setAccessible(Method.java:192) at org.apache.ignite.internal.util.IgniteUtils.property(IgniteUtils.java:8297) ... 6 more
      

      Under Java 8 metric has expected value.

       

      Solution:

      The behaviour is expected because in Java 11 the CPU load metrics is moved to JDK internal module which is not accessible by default. Adding the following line to the jvm in which Ignite node is started should solve the issue:

      --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                maliev Mirza Aliev
                Reporter:
                maliev Mirza Aliev
              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m