File tree 1 file changed +3
-2
lines changed
src/main/java/com/rabbitmq/stream/perf
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -560,6 +560,8 @@ public Integer call() throws Exception {
560
560
this .messageSize = this .messageSize < 8 ? 8 : this .messageSize ; // we need to store a long in it
561
561
562
562
ShutdownService shutdownService = new ShutdownService ();
563
+ Thread shutdownServiceShutdownHook = new Thread (() -> shutdownService .close ());
564
+ Runtime .getRuntime ().addShutdownHook (shutdownServiceShutdownHook );
563
565
564
566
try {
565
567
@@ -570,8 +572,6 @@ public Integer call() throws Exception {
570
572
571
573
shutdownService .wrap (closeStep ("Closing monitoring context" , monitoringContext ::close ));
572
574
573
- Runtime .getRuntime ().addShutdownHook (new Thread (() -> shutdownService .close ()));
574
-
575
575
// FIXME add confirm latency
576
576
577
577
ScheduledExecutorService envExecutor =
@@ -958,6 +958,7 @@ public Integer call() throws Exception {
958
958
}
959
959
} finally {
960
960
shutdownService .close ();
961
+ Runtime .getRuntime ().removeShutdownHook (shutdownServiceShutdownHook );
961
962
}
962
963
963
964
return 0 ;
You can’t perform that action at this time.
0 commit comments