diff --git a/services/src/main/java/io/druid/cli/CliPeon.java b/services/src/main/java/io/druid/cli/CliPeon.java index 9676cb41c38..4e9f138aee9 100644 --- a/services/src/main/java/io/druid/cli/CliPeon.java +++ b/services/src/main/java/io/druid/cli/CliPeon.java @@ -305,7 +305,12 @@ public class CliPeon extends GuiceRunnable // Explicitly call lifecycle stop, dont rely on shutdown hook. lifecycle.stop(); - Runtime.getRuntime().removeShutdownHook(hook); + try { + Runtime.getRuntime().removeShutdownHook(hook); + } + catch (IllegalStateException e) { + log.warn("Cannot remove shutdown hook, already shutting down"); + } } catch (Throwable t) { log.error(t, "Error when starting up. Failing.");