You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/09/04 17:42:00 UTC

[jira] [Commented] (DRILL-6702) OperatingSystemMXBean class cast exception when loaded under IBM JVM

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

ASF GitHub Bot commented on DRILL-6702:
---------------------------------------

arina-ielchiieva commented on a change in pull request #1437: DRILL-6702: Disable CPU Reporting for non-HotSpot JDKs
URL: https://github.com/apache/drill/pull/1437#discussion_r215004905
 
 

 ##########
 File path: common/src/main/java/org/apache/drill/exec/metrics/CpuGaugeSet.java
 ##########
 @@ -49,6 +51,15 @@ public CpuGaugeSet() {
     metric.put("drillbit.uptime", new DrillbitUptime(rtMXBean));
     return metric;
   }
+
+  private static OperatingSystemMXBean getOSMXBeanForCpuMetrics() {
+    try {
+      return (OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean();
+    } catch (Exception ex) {
 
 Review comment:
   Not sure how it can throw other exception instead of class cast. I liked version with more narrow exception better.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> OperatingSystemMXBean class cast exception when loaded under IBM JVM
> --------------------------------------------------------------------
>
>                 Key: DRILL-6702
>                 URL: https://issues.apache.org/jira/browse/DRILL-6702
>             Project: Apache Drill
>          Issue Type: Improvement
>    Affects Versions: 1.14.0
>            Reporter: Rob Wu
>            Assignee: Kunal Khatua
>            Priority: Minor
>              Labels: ready-to-commit
>             Fix For: 1.15.0
>
>
> Related to: https://issues.apache.org/jira/browse/DRILL-6289
>  
> [https://github.com/apache/drill/blob/1.14.0/common/src/main/java/org/apache/drill/exec/metrics/CpuGaugeSet.java#L28|https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_apache_drill_blob_1.14.0_common_src_main_java_org_apache_drill_exec_metrics_CpuGaugeSet.java-23L28&d=DwMFAg&c=cskdkSMqhcnjZxdQVpwTXg&r=-cT6otg6lpT_XkmYy7yg3A&m=f8a5MyR85-7Ns3KmymU7PI8Sk6qW8vRa9HJIa0-npNA&s=mpztPtwrTzNkgLcUORZdl5LQ6gyP5iAf3umFzgdOMeI&e=]
>  
> Exception in thread "main" java.lang.ExceptionInInitializerError
>     at java.lang.J9VMInternals.ensureError(J9VMInternals.java:141)
>     at java.lang.J9VMInternals.recordInitializationFailure(J9VMInternals.java:130)
>     at org.apache.drill.exec.metrics.DrillMetrics.getRegistry(DrillMetrics.java:111)
>     at org.apache.drill.exec.memory.AllocationManager.<clinit>(AllocationManager.java:64)
>     at org.apache.drill.exec.memory.BaseAllocator.<clinit>(BaseAllocator.java:48)
>     at org.apache.drill.exec.memory.RootAllocatorFactory.newRoot(RootAllocatorFactory.java:45)
>     at org.apache.drill.exec.memory.RootAllocatorFactory.newRoot(RootAllocatorFactory.java:40)
>     ...
> Caused by: java.lang.ClassCastException: com.ibm.lang.management.ExtendedOperatingSystem incompatible with com.sun.management.OperatingSystemMXBean
>     at org.apache.drill.exec.metrics.CpuGaugeSet.<init>(CpuGaugeSet.java:40)
>     at org.apache.drill.exec.metrics.DrillMetrics$RegistryHolder.registerSystemMetrics(DrillMetrics.java:63)
>     at org.apache.drill.exec.metrics.DrillMetrics$RegistryHolder.<clinit>(DrillMetrics.java:53)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)