Don't die on NoClassDefFoundError
@@ -63,15 +63,15 @@ public class Deconstructor implements ComponentDeconstructor {
try {
component.deconstruct();
log.info("Finished deconstructing " + component);
- } catch (Error e) {
+ }
+ catch (Exception | NoClassDefFoundError e) { // May get class not found due to it being already unloaded
+ log.log(WARNING, "Exception thrown when deconstructing " + component, e);
+ }
+ catch (Error e) {
try {
Thread.sleep((long) (new Random(System.nanoTime()).nextDouble() * 180 * 1000));
} catch (InterruptedException exception) { }
com.yahoo.protect.Process.logAndDie("Error when deconstructing " + component, e);
- } catch (Exception e) {
- log.log(WARNING, "Exception thrown when deconstructing " + component, e);
- } catch (Throwable t) {
- log.log(WARNING, "Unexpected Throwable thrown when deconstructing " + component, t);
}
}
}
