Github user vrozov commented on a diff in the pull request:
https://github.com/apache/drill/pull/1105#discussion_r173527617
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/work/fragment/FragmentExecutor.java
---
@@ -227,11 +280,19 @@ public void run() {
@Override
public Void run() throws Exception {
injector.injectChecked(fragmentContext.getExecutionControls(),
"fragment-execution", IOException.class);
- /*
- * Run the query until root.next returns false OR we no longer
need to continue.
- */
- while (shouldContinue() && root.next()) {
- // loop
+
+ while (shouldContinue()) {
+ // Fragment is not cancelled
+
+ for (FragmentHandle fragmentHandle; (fragmentHandle =
receiverFinishedQueue.poll()) != null;) {
--- End diff --
How this processing affects `root.next()`? Should it be also/only done
after fragment is canceled or done (after while loop)?
---