NIFI-145: Fixed stack trace that occassionally occurs on shutdown

This commit is contained in:
Mark Payne 2014-12-10 12:17:32 -05:00
parent 97f8ab0cc5
commit f63cd9a15e
1 changed files with 5 additions and 1 deletions

View File

@ -397,7 +397,11 @@ public class RunNiFi {
} catch (final InterruptedException ie) { } catch (final InterruptedException ie) {
} }
} else { } else {
runtime.removeShutdownHook(shutdownHook); try {
runtime.removeShutdownHook(shutdownHook);
} catch (final IllegalStateException ise) {
// happens when already shutting down
}
if (autoRestartNiFi) { if (autoRestartNiFi) {
System.out.println("Apache NiFi appears to have died. Restarting..."); System.out.println("Apache NiFi appears to have died. Restarting...");