sashapolo commented on code in PR #722:
URL: https://github.com/apache/ignite-3/pull/722#discussion_r850177601


##########
modules/cluster-management/src/main/java/org/apache/ignite/internal/cluster/management/ClusterInitializer.java:
##########
@@ -114,15 +121,17 @@ private CompletableFuture<Void> 
invokeMessage(Collection<ClusterNode> nodes, Net
                         .invoke(node, message, 10000)
                         .thenAccept(response -> {
                             if (response instanceof InitErrorMessage) {
-                                throw new InitException(String.format(
-                                        "Got error response from node \"%s\": 
%s", node.name(), ((InitErrorMessage) response).cause()
-                                ));
-                            }
-
-                            if (!(response instanceof InitCompleteMessage)) {
-                                throw new InitException(String.format(
-                                        "Unexpected response from node \"%s\": 
%s", node.name(), response.getClass()
-                                ));
+                                var errorResponse = (InitErrorMessage) 
response;
+
+                                throw new InternalInitException(
+                                        String.format("Got error response from 
node \"%s\": %s", node.name(), errorResponse.cause()),
+                                        errorResponse.shouldCancel()
+                                );
+                            } else if (!(response instanceof 
InitCompleteMessage)) {

Review Comment:
   If a message is neither an `InitErrorMessage` and also does not satisfy the 
`!(response instanceof InitCompleteMessage)` condition, then it can only mean 
one thing - this is an `InitCompleteMessage` in which case the procedure has 
completed successfully and we don't need to do anything



-- 
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