public static void crashGlobalVoltDB ( String errMsg , boolean stackTrace , Throwable t ) { // for test code wasCrashCalled = true ; crashMessage = errMsg ; if ( ignoreCrash ) { throw new AssertionError ( "Faux crash of VoltDB successful." ) ; } // end test code // send a snmp trap crash notification sendCrashSNMPTrap ( errMsg ) ; try { // turn off client interface as fast as possible // we don't expect this to ever fail, but if it does, skip to dying immediately if ( ! turnOffClientInterface ( ) ) { return ; // this will jump to the finally block and die faster } // instruct the rest of the cluster to die instance ( ) . getHostMessenger ( ) . sendPoisonPill ( errMsg ) ; // give the pill a chance to make it through the network buffer Thread . sleep ( 500 ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; // sleep even on exception in case the pill got sent before the exception try { Thread . sleep ( 500 ) ; } catch ( InterruptedException e2 ) { } } // finally block does its best to ensure death, no matter what context this // is called in finally { crashLocalVoltDB ( errMsg , stackTrace , t ) ; } }
Exit the process with an error message optionally with a stack trace . Also notify all connected peers that the node is going down .