dawidwys commented on a change in pull request #16589:
URL: https://github.com/apache/flink/pull/16589#discussion_r678471021



##########
File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/MultipleInputSelectionHandler.java
##########
@@ -101,20 +114,26 @@ public DataInputStatus calculateOverallStatus() throws 
IOException {
     }
 
     void nextSelection() {
-        if (inputSelectable == null) {
-            inputSelection = InputSelection.ALL;
+        if (inputSelectable == null || areAllDataInputsFinished()) {
+            selectedInputsMask = InputSelection.ALL.getInputMask();
+        } else if (dataFinishedButNotPartition != 0) {
+            selectedInputsMask =
+                    (inputSelectable.nextSelection().getInputMask() | 
dataFinishedButNotPartition)
+                            & allSelectedMask;
         } else {
-            inputSelection = inputSelectable.nextSelection();
+            selectedInputsMask = 
inputSelectable.nextSelection().getInputMask();

Review comment:
       I took a slightly different approach and I recalculate the 
`areAllDataInputsFinished` only when I receive the `END_OF_DATA`. It should be 
effectively very similar to what you're suggesting.




-- 
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: [email protected]

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


Reply via email to