Skip to content

Commit

Permalink
Ignore exception when trying to remove Git data upload shutdown hook …
Browse files Browse the repository at this point in the history
…during JVM shutdown (#7204)
  • Loading branch information
nikita-tkachenko-datadog committed Jun 17, 2024
1 parent a5c4323 commit 841d933
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,15 @@ private void uploadGitData() {
LOGGER.error("Failed to upload git tree data for remote {}", remoteName, e);
callback.completeExceptionally(e);
} finally {
removeShutdownHook();
}
}

private void removeShutdownHook() {
try {
Runtime.getRuntime().removeShutdownHook(uploadFinishedShutdownHook);
} catch (IllegalStateException e) {
// JVM is being shutdown
}
}

Expand Down

0 comments on commit 841d933

Please sign in to comment.