We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 09efe3f commit b17a983Copy full SHA for b17a983
src/main/java/com/rabbitmq/stream/perf/StreamPerfTest.java
@@ -936,9 +936,12 @@ public Integer call() throws Exception {
936
shutdownService.wrap(closeStep("Closing metrics", () -> this.performanceMetrics.close()));
937
938
CountDownLatch latch = new CountDownLatch(1);
939
- Runtime.getRuntime().addShutdownHook(new Thread(() -> latch.countDown()));
+
940
+ Thread shutdownHook = new Thread(() -> latch.countDown());
941
+ Runtime.getRuntime().addShutdownHook(shutdownHook);
942
try {
943
latch.await();
944
+ Runtime.getRuntime().removeShutdownHook(shutdownHook);
945
} catch (InterruptedException e) {
946
// moving on to the closing sequence
947
}
0 commit comments