@@ -99,22 +99,6 @@ public void addCallbackOnExitExceptionHandler(Class c, CallbackOnExitHandler exi
99
99
public void handleThrowable (final Thread thread , final Throwable t ) {
100
100
handlePossibleOOME (t );
101
101
102
- if (isThreadGroupDestroyed (thread , t )) {
103
- logger .warn ("Ignoring an attempt to start a JMX thread during shutdown." , t );
104
- return ;
105
- }
106
-
107
- if (isJMXTerminatedException (t )) {
108
- logger .warn ("Ignoring a Thread Service termination error from JMX." , t );
109
- return ;
110
- }
111
-
112
- if (isNotificationFetcherThread (thread )) {
113
- // DEV-5006 -- Do not exit L2.
114
- logger .warn ("Got Exception in JMX Notification forwarding" , t );
115
- return ;
116
- }
117
-
118
102
final CallbackOnExitState throwableState = new CallbackOnExitState (t );
119
103
scheduleExit (throwableState );
120
104
@@ -137,19 +121,6 @@ public void handleThrowable(final Thread thread, final Throwable t) {
137
121
exit (throwableState );
138
122
}
139
123
140
- private static boolean isThreadGroupDestroyed (Thread thread , Throwable t ) {
141
- // see EHCTERR-32
142
- if (t instanceof IllegalThreadStateException ) {
143
- StackTraceElement [] stack = t .getStackTrace ();
144
- StackTraceElement bottom = stack [stack .length - 1 ];
145
- if (stack [0 ].getClassName ().equals ("java.lang.ThreadGroup" ) && stack [0 ].getMethodName ().equals ("addUnstarted" )
146
- && bottom .getClassName ().equals ("javax.management.remote.generic.GenericConnectorServer$Receiver" )
147
- && bottom .getMethodName ().equals ("run" )) { return true ; }
148
- }
149
-
150
- return false ;
151
- }
152
-
153
124
/**
154
125
* Makes sure we don't allocate any heap objects on OOME.
155
126
* {@code -XX:+HeapDumpOnOutOfMemoryError} should take care of debug information.
@@ -227,26 +198,4 @@ protected synchronized void exit(int status) {
227
198
ThreadUtil .reallySleep (2000 );
228
199
System .exit (status );
229
200
}
230
-
231
- private static boolean isNotificationFetcherThread (Thread thread ) {
232
- // UGLY Way to Ignore exception in JMX Notification Forwarder Thread.
233
- try {
234
- Field runnableField = thread .getClass ().getDeclaredField ("target" );
235
- runnableField .setAccessible (true );
236
- Object runnable = runnableField .get (thread );
237
- if (runnable != null && runnable .getClass ().getSimpleName ().equals ("NotifFetcher" )) {
238
- return true ;
239
- } else {
240
- return false ;
241
- }
242
- } catch (Throwable e ) {
243
- return false ;
244
- }
245
-
246
- }
247
-
248
- private static boolean isJMXTerminatedException (Throwable throwable ) {
249
- return throwable instanceof IllegalStateException &&
250
- throwable .getMessage ().contains ("The Thread Service has been terminated." );
251
- }
252
201
}
0 commit comments