You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Mirza Aliev (Jira)" <ji...@apache.org> on 2020/07/28 21:12:00 UTC

[jira] [Comment Edited] (IGNITE-13306) CpuLoad metric return -1 under Java 11

    [ https://issues.apache.org/jira/browse/IGNITE-13306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17166695#comment-17166695 ] 

Mirza Aliev edited comment on IGNITE-13306 at 7/28/20, 9:11 PM:
----------------------------------------------------------------

Hi [Ivan Bessonov|https://issues.apache.org/jira/secure/ViewProfile.jspa?name=ibessonov]! 

Thank you for your comments! 

On the one hand I agree with you that your ideas might be more correct in terms of simplification of the existing code, namely MetricsUpdater. On the other hand the way we fixed this problem is more reliable because we do not change MetricsUpdater at all, we only add a key for jvm to support existing functionality. 

There is another point for this fix, we discussed with [Denis Mekhanikov|https://issues.apache.org/jira/secure/ViewProfile.jspa?name=dmekhanikov] and agreed that this fix is critical for Control Center and it would be nice to have it in the upcoming 2.9 release, given the fact that this fix was properly tested on a fork.

Therefore, to sum up, I would propose the following: merge this fix and cherry-pick to 2.9 release, and create another ticket for improvements for retrieving properties using reflection and for MetricsUpdater.  

 

What do you think [Ivan Bessonov|https://issues.apache.org/jira/secure/ViewProfile.jspa?name=ibessonov] , [Denis Mekhanikov|https://issues.apache.org/jira/secure/ViewProfile.jspa?name=dmekhanikov] ?


was (Author: maliev):
Hi [~ibessonov]! 

Thank you for your comments! 

On the one hand I agree with you that your ideas might be more correct in terms of simplification of the existing code, namely {{MetricsUpdater}}. On the other hand the way how we fixed this problem is more reliable because we do not change {{MetricsUpdater}} at all, we only add key for jvm to support existing functionality. 

There is another point for this fix, we discussed with [~dmekhanikov] and agreed that this fix is critical for Control Center and it would be nice to have it in upcoming 2.9 release, given the fact that this fix was properly tested on a fork.

Therefore, to sum up, I would propose the following: merge this fix and cherry-pick to 2.9 release, and create another ticket for improvements for retrieving properties using reflection and for {{MetricsUpdater.}}  

 

What do you think [~ibessonov] , [~dmekhanikov] ?

> CpuLoad metric return -1 under Java 11
> --------------------------------------
>
>                 Key: IGNITE-13306
>                 URL: https://issues.apache.org/jira/browse/IGNITE-13306
>             Project: Ignite
>          Issue Type: Bug
>    Affects Versions: 2.8.1
>            Reporter: Mirza Aliev
>            Assignee: Mirza Aliev
>            Priority: Major
>             Fix For: 2.9
>
>
> 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:
> {code:java}
> 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
> {code}
> 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:
> {noformat}
> --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED{noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)