diff --git a/jetty-load-generator-client/src/main/java/org/mortbay/jetty/load/generator/LoadGenerator.java b/jetty-load-generator-client/src/main/java/org/mortbay/jetty/load/generator/LoadGenerator.java index 5ddb8a56..7ba913e6 100644 --- a/jetty-load-generator-client/src/main/java/org/mortbay/jetty/load/generator/LoadGenerator.java +++ b/jetty-load-generator-client/src/main/java/org/mortbay/jetty/load/generator/LoadGenerator.java @@ -205,16 +205,16 @@ public CompletableFuture begin() { .thenCompose(v -> CompletableFuture.allOf(responses)); }) .thenRun(this::fireCompleteEvent) - // HttpClient cannot be stopped from one of its own threads. - .whenCompleteAsync((r, x) -> - { - if (LOGGER.isDebugEnabled()) + // HttpClient cannot be stopped from one of its own threads. + .whenCompleteAsync((r, x) -> { - LOGGER.debug("stopping http clients"); - } - Collection clients = getBeans(HttpClient.class); - clients.forEach(this::stopHttpClient); - }, executorService) + if (LOGGER.isDebugEnabled()) + { + LOGGER.debug("stopping http clients"); + } + Collection clients = getBeans(HttpClient.class); + clients.forEach(this::stopHttpClient); + }, executorService) // Call halt() even if previous stages failed. .whenCompleteAsync((r, x) -> halt(), executorService); }