Cyrill commented on code in PR #3629:
URL: https://github.com/apache/ignite-3/pull/3629#discussion_r1580051040


##########
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:
   The same applies to start then. I suggest we raise a separate JIRA to cover 
that



##########
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 suggest we raise a separate JIRA to cover that



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to