rkhachatryan commented on a change in pull request #15716:
URL: https://github.com/apache/flink/pull/15716#discussion_r620365369



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/SingleInputGate.java
##########
@@ -730,6 +730,12 @@ private BufferOrEvent transformEvent(
 
         if (event.getClass() == EndOfPartitionEvent.class) {
             
channelsWithEndOfPartitionEvents.set(currentChannel.getChannelIndex());
+            synchronized (inputChannelsWithData) {
+                
enqueuedInputChannelsWithData.clear(currentChannel.getChannelIndex());
+                if (inputChannelsWithData.contains(currentChannel)) {
+                    inputChannelsWithData.getAndRemove(channel -> channel == 
currentChannel);
+                }
+            }

Review comment:
       > A concurrent queueChannel may come after this block and before 
releaseAllResources.
   
   That's a very good point! 
   I think it would be even better to check `channelsWithEndOfPartitionEvents` 
in `queueChannelUnsafe`.
   WDYT? (I've updated the PR accordingly).




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