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


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/rel/AsyncRootNode.java:
##########
@@ -255,11 +253,17 @@ private void flush() throws Exception {
             currentReq.fut.complete(new BatchedResult<>(currentReq.buff, 
hasMore == HasMore.YES));
         }
 
-        if (waiting == 0 && buff.isEmpty()) {
-            //noinspection NestedAssignment
-            source.request(waiting = IN_BUFFER_SIZE);
-        } else if (hasMore == HasMore.NO) {
-            closeAsync();
+        if (buff.isEmpty()) {
+            if (waiting == 0) {
+                //noinspection NestedAssignment
+                source.request(waiting = IN_BUFFER_SIZE);
+            } else if (waiting == -1) {
+                assert hasMore == HasMore.NO : hasMore;
+
+                closeAsync();
+            }
+        } else if (!pendingRequests.isEmpty()) {
+            source.context().execute(this::flush, source::onError);
         }

Review Comment:
   nice catch! fixed



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

Reply via email to