davidradl commented on code in PR #26492: URL: https://github.com/apache/flink/pull/26492#discussion_r2058580961
########## flink-runtime/src/main/java/org/apache/flink/runtime/metrics/util/MetricUtils.java: ########## @@ -338,6 +339,30 @@ static void instantiateMetaspaceMemoryMetrics(final MetricGroup parentMetricGrou } } + static void instantiateFileDescriptorMetrics(MetricGroup metrics) { + try { + final com.sun.management.OperatingSystemMXBean mxBean = + (com.sun.management.OperatingSystemMXBean) + ManagementFactory.getOperatingSystemMXBean(); + + if (mxBean instanceof com.sun.management.UnixOperatingSystemMXBean) { Review Comment: > Yes, it will throw exception and caught in line 358. Ok thanks. In the case where the instanceof fails it would be good to mention the that JVM does not have this class in the error message, maybe a separate catch to give a more informative message. How do we get into the else case? Can a bean of the wrong type get into this code? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org