sanpwc commented on code in PR #3629: URL: https://github.com/apache/ignite-3/pull/3629#discussion_r1579864902
########## modules/runner/src/main/java/org/apache/ignite/internal/app/LifecycleManager.java: ########## @@ -148,12 +153,11 @@ private synchronized void stopAllComponents() { } }); - new ReverseIterator<>(startedComponents).forEachRemaining(component -> { - try { - component.stop(); - } catch (Exception e) { - LOG.warn("Unable to stop component [component={}, nodeName={}]", e, component, nodeName); - } - }); + List<CompletableFuture<Void>> allComponentsStopFuture = new ArrayList<>(); + + new ReverseIterator<>(startedComponents).forEachRemaining(component -> allComponentsStopFuture.add(component.stopAsync())); + + allOf(allComponentsStopFuture.toArray(CompletableFuture[]::new)) + .whenComplete((v, e) -> stopFuture.complete(null)); Review Comment: I'd say that we should explicitly specify pool to execute start/stop, otherwise we may switch thread unpredictably. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org