Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Commit

Permalink
Catch IllegalStateException during shutdown hook removal attempt...
Browse files Browse the repository at this point in the history
...when shutdown is already in progress

Signed-off-by: Tomas Hofman <thofman@redhat.com>
  • Loading branch information
TomasHofman committed Feb 13, 2020
1 parent 74adce4 commit fa4b360
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -227,7 +227,11 @@ public void close() {
reporter.close();
sampler.close();
if (shutdownHook != null) {
Runtime.getRuntime().removeShutdownHook(shutdownHook);
try {
Runtime.getRuntime().removeShutdownHook(shutdownHook);
} catch (IllegalStateException e) {
log.info("Can't remove shutdown hook, shutdown already in progress.");
}
}
}

Expand Down

0 comments on commit fa4b360

Please sign in to comment.