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 9a78652 commit 742da46
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,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 742da46

Please sign in to comment.