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_r318569030
 
 

 ##########
 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:
   I think this is not quite correct. What if `status == NOTHING_AVAILABLE` and 
for example `secondInputStatus == MORE_AVAILABLE`? Result should be 
`MORE_AVAILABLE` as long as input selection is correct. 
   
   Similar, what about `status == END_OF_INPUT` and `secondInputStatus == 
MORE_AVAILABLE`? Currently that would return `NOTHING_AVAILABLE`?
   
   Am I missing something, or is this wrong? If this is a bug, please also add 
a test coverage for those (and potentially other corner cases).

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