File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
src/main/java/com/rabbitmq/perf Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ public static void main(String [] args, PerfTestOptions perfTestOptions) {
5656 shutdownService .wrap (() -> metrics .close ());
5757 Options metricsOptions = metrics .options ();
5858 forEach (metricsOptions , option -> options .addOption (option ));
59+ int exitStatus = 0 ;
5960 try {
6061 CommandLine rawCmd = parser .parse (options , args );
6162 CommandLineProxy cmd = new CommandLineProxy (options , rawCmd , perfTestOptions .argumentLookup );
@@ -325,17 +326,18 @@ public static void main(String [] args, PerfTestOptions perfTestOptions) {
325326 set .run (true );
326327
327328 stats .printFinal ();
328- }
329- catch (ParseException exp ) {
329+ } catch (ParseException exp ) {
330330 System .err .println ("Parsing failed. Reason: " + exp .getMessage ());
331331 usage (options );
332332 } catch (Exception e ) {
333333 System .err .println ("Main thread caught exception: " + e );
334334 LOGGER .error ("Main thread caught exception" , e );
335- systemExiter . exit ( 1 ) ;
335+ exitStatus = 1 ;
336336 } finally {
337337 shutdownService .close ();
338338 }
339+ // we need to exit explicitly, without waiting alive threads (e.g. when using --shutdown-timeout 0)
340+ systemExiter .exit (exitStatus );
339341 }
340342
341343 private static PrintWriter openCsvFileForWriting (String outputFile , ShutdownService shutdownService ) throws IOException {
You can’t perform that action at this time.
0 commit comments