korlov42 commented on code in PR #2241:
URL: https://github.com/apache/ignite-3/pull/2241#discussion_r1244714682


##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/api/ItSqlAsynchronousApiTest.java:
##########
@@ -690,7 +689,7 @@ public void closeSession() {
 
         assertThrowsWithCause(
                 () -> await(ars0.fetchNextPage()),
-                ExecutionCancelledException.class
+                CursorClosedException.class

Review Comment:
   the same



##########
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/StopCalciteModuleTest.java:
##########
@@ -284,7 +284,7 @@ public void testStopQueryOnNodeStop() throws Exception {
         await(request.exceptionally(t -> {
             assertInstanceOf(CompletionException.class, t);
             assertInstanceOf(IgniteException.class, t.getCause());
-            assertInstanceOf(ExecutionCancelledException.class, 
t.getCause().getCause());
+            assertInstanceOf(CursorClosedException.class, 
t.getCause().getCause());

Review Comment:
   and here



##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ExecutionServiceImpl.java:
##########
@@ -824,47 +824,62 @@ private void enlist(SourceAwareIgniteRel rel) {
             }.visit(fragment.root());
         }
 
-        private CompletableFuture<Void> close(boolean cancel) {
+        private CompletableFuture<Void> close() {
             if (!cancelled.compareAndSet(false, true)) {
-                return cancelFut.thenApply(Function.identity());
+                return cancelFut;
             }
 
-            CompletableFuture<Void> start = closeExecNode(cancel);
+            CompletableFuture<Void> start = closeExecNode();
 
             start
-                    .thenCompose(tmp -> {
-                        CompletableFuture<Void> cancelResult = coordinator
-                                ? awaitFragmentInitialisationAndClose()
-                                : closeLocalFragments();
-
-                        var finalStepFut = cancelResult.whenComplete((r, e) -> 
{
-                            queryManagerMap.remove(ctx.queryId());
-
-                            try {
-                                ctx.cancel().cancel();
-                            } catch (Exception ignored) {
-                                // NO-OP
-                            }
+            .thenCompose(tmp -> {

Review Comment:
   indentation 



##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ExecutionServiceImpl.java:
##########
@@ -888,14 +903,6 @@ private CompletableFuture<Void> 
awaitFragmentInitialisationAndClose() {
 
                 cancelFuts.add(
                         CompletableFuture.allOf(entry.getValue().toArray(new 
CompletableFuture[0]))
-                                .handle((none2, t) -> {
-                                    // Some fragments may be completed 
exceptionally, and that is fine.
-                                    // Here we need to make sure that all 
query initialisation requests
-                                    // have been processed before sending a 
cancellation request. That's
-                                    // why we just ignore any exception.
-
-                                    return null;
-                                })

Review Comment:
   why did you remove this?



##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/api/ItCommonApiTest.java:
##########
@@ -107,7 +105,7 @@ public void testSessionExpiration() throws Exception {
             while (rs1.hasNext()) {
                 rs1.next();
             }
-        }, ExecutionCancelledException.class);
+        }, CursorClosedException.class);

Review Comment:
   well, I think this change is not correct. In my opinion, we need to 
distinguish between cursor closed by users' intention and cursor closed by 
system intention



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