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 <[email protected]>
  • Loading branch information
TomasHofman committed Feb 13, 2020
1 parent 74adce4 commit 23e2d25
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
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 23e2d25

Please sign in to comment.