-
Bug
-
Resolution: Unresolved
-
P4
-
8u111
Users using the jvmstat API might register a VmListener in order to get notified on monitor updates (fireMonitorsUpdatedEvents() in LocalMonitoredVm.java).
Internally a Timer is used to notify listeners on a given interval. However, when a NotifierTask throws an unchecked exception, the Timer dies, preventing any further updates for any monitors.
One such instance where a runtime exception might occur in NotifierTask is when a JVM is currently active waiting for a debugger to attach.
This could be a potential fix:
diff --git a/src/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/LocalMonitoredVm.java b/src/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/LocalMonitoredVm.java
--- a/src/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/LocalMonitoredVm.java
+++ b/src/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/LocalMonitoredVm.java
@@ -202,6 +202,11 @@
System.err.println("Exception updating monitors for "
+ getVmIdentifier());
e.printStackTrace();
+ } catch (Throwable e) {
+ // XXX: use logging api
+ System.err.println("Exception updating monitors for "
+ + getVmIdentifier());
+ e.printStackTrace();
}
}
}
Internally a Timer is used to notify listeners on a given interval. However, when a NotifierTask throws an unchecked exception, the Timer dies, preventing any further updates for any monitors.
One such instance where a runtime exception might occur in NotifierTask is when a JVM is currently active waiting for a debugger to attach.
This could be a potential fix:
diff --git a/src/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/LocalMonitoredVm.java b/src/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/LocalMonitoredVm.java
--- a/src/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/LocalMonitoredVm.java
+++ b/src/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/LocalMonitoredVm.java
@@ -202,6 +202,11 @@
System.err.println("Exception updating monitors for "
+ getVmIdentifier());
e.printStackTrace();
+ } catch (Throwable e) {
+ // XXX: use logging api
+ System.err.println("Exception updating monitors for "
+ + getVmIdentifier());
+ e.printStackTrace();
}
}
}
- relates to
-
JDK-6637230 jps doesn't work for application waiting for direct attach
- Closed