jaehwan0214 commented on a change in pull request #304:
URL: https://github.com/apache/incubator-nemo/pull/304#discussion_r519586713



##########
File path: 
runtime/executor/src/main/java/org/apache/nemo/runtime/executor/task/MultiThreadParentTaskDataFetcher.java
##########
@@ -127,14 +129,19 @@ private void fetchDataLazily() {
                   watermarkWithIndex.getIndex(), 
watermarkWithIndex.getWatermark());
               }
             } else {
+              if (element instanceof Finishmark) {
+                isFinishMarkProduced = true;
+              }
               // data element
               elementQueue.offer(element);
             }
           }
-
           // This iterator is finished.
           countBytesSynchronized(iterator);
-          elementQueue.offer(Finishmark.getInstance());
+          // If the current iterator hasn't produced finish mark, put it into 
the global queue.
+          if (!isFinishMarkProduced) {

Review comment:
       We shouldn't throw an exception. In the case of using ByteTransfer 
Context, its iterator doesn't produce a finish mark as an element at the end. 
But in the case of LocalTransfer context, its iterator produces a finish mark 
as an element at the end. So isFinishmarkProduced is to prevent producing two 
finish marks when the LocalTransfer context's iterator is finished.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to