You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "zstan (via GitHub)" <gi...@apache.org> on 2023/04/26 14:33:16 UTC

[GitHub] [ignite-3] zstan commented on a diff in pull request #1980: IGNITE-17685 Sql. SQL engine should send messages asynchronously

zstan commented on code in PR #1980:
URL: https://github.com/apache/ignite-3/pull/1980#discussion_r1177794311


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ExecutionServiceImpl.java:
##########
@@ -467,15 +467,22 @@ private void sendFragment(
                     .schemaVersion(ctx.schemaVersion())
                     .build();
 
-            var fut = new CompletableFuture<Void>();
-            remoteFragmentInitCompletion.put(new RemoteFragmentKey(targetNodeName, fragment.fragmentId()), fut);
+            CompletableFuture<Void> remoteFragmentInitializationCompletionFuture = new CompletableFuture<>();
 
-            try {
-                messageService.send(targetNodeName, req);
-            } catch (Exception ex) {
-                fut.complete(null);
+            remoteFragmentInitCompletion.put(
+                    new RemoteFragmentKey(targetNodeName, fragment.fragmentId()),
+                    remoteFragmentInitializationCompletionFuture
+            );
 
-                throw ex;
+            try {
+                return messageService.send(targetNodeName, request);
+            } catch (Throwable th) {
+                // it's not expected MessageService to throw any exception, yet it may be possible

Review Comment:
   it confusing me, i think we don\`t need to write about expectations, as you mention - it\`s implementation dependent, additionally for now it throws NODE_LEFT_ERR. I suggest to change this comment.



##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ExecutionServiceImpl.java:
##########
@@ -543,21 +550,19 @@ private void executeFragment(IgniteRel treeRoot, ExecutionContext<RowT> ectx) {
                 root.complete(rootNode);
             }
 
-            try {
-                messageService.send(
-                        origNodeName,
-                        FACTORY.queryStartResponse()
-                                .queryId(ectx.queryId())
-                                .fragmentId(ectx.fragmentId())
-                                .build()
-                );
-            } catch (IgniteInternalCheckedException e) {
-                throw new IgniteInternalException(MESSAGE_SEND_ERR, "Failed to send reply. [nodeName=" + origNodeName + ']', e);

Review Comment:
   MESSAGE_SEND_ERR used only in tests for now



-- 
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-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org