pnowojski commented on a change in pull request #9483: [FLINK-13767][task] 
Migrate isFinished method from AvailabilityListener to AsyncDataInput
URL: https://github.com/apache/flink/pull/9483#discussion_r319507036
 
 

 ##########
 File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/StreamTwoInputSelectableProcessor.java
 ##########
 @@ -194,23 +193,28 @@ public boolean processInput() throws Exception {
 
                int readingInputIndex = selectNextReadingInputIndex();
                if (readingInputIndex == -1) {
-                       return false;
+                       return InputStatus.NOTHING_AVAILABLE;
                }
                lastReadInputIndex = readingInputIndex;
 
                InputStatus status;
                if (readingInputIndex == 0) {
                        status = input1.emitNext(output1);
+                       firstInputStatus = status;
                } else {
                        status = input2.emitNext(output2);
+                       secondInputStatus = status;
                }
                checkFinished(status, lastReadInputIndex);
 
                if (status == InputStatus.NOTHING_AVAILABLE) {
                        
inputSelectionHandler.setUnavailableInput(readingInputIndex);
                }
 
-               return status == InputStatus.MORE_AVAILABLE;
+               if (status == InputStatus.END_OF_INPUT && secondInputStatus != 
InputStatus.END_OF_INPUT) {
 
 Review comment:
   Hmmm, maybe we should clean this up?
   
   I think previously it was not that bad, as it was more of an optimisation, 
to avoid checking `isAvailable()` when hot looping (touching `isAvailable()` 
means touching `volatile` field inside `CompletableFuture`). 
   
   Now that we want to actually express `END_OF_INPUT` as well, we might need 
to be more precise here.
   
   Do you think it would be difficult to fix this logic here?

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


With regards,
Apache Git Services

Reply via email to