zhijiangW commented on a change in pull request #8566: [FLINK-12673][network] 
Introduce NetworkEnvironment.getUnreleasedPartitions instead of using 
getResultPartitionManager
URL: https://github.com/apache/flink/pull/8566#discussion_r288838989
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/ResultPartitionManager.java
 ##########
 @@ -122,14 +123,9 @@ void onConsumedPartition(ResultPartition partition) {
                }
        }
 
-       public boolean areAllPartitionsReleased() {
+       public Collection<ResultPartitionID> getUnreleasedPartitions() {
                synchronized (registeredPartitions) {
-                       for (ResultPartition partition : 
registeredPartitions.values()) {
-                               if (!partition.isReleased()) {
-                                       return false;
-                               }
-                       }
-                       return true;
+                       return registeredPartitions.keySet();
 
 Review comment:
   The behavior here is different from before. We should confirm the criteria 
whether based on collection size or real partition state. It exists the 
scenario that the partition is already removed from the collection but the 
state is not released yet during`ResultPartitionManager#onConsumedPartition`. 
That means if we release the task executor immediately, it might lose chance 
for releasing the partition resource gracefully. WDYT?

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