zhijiangW commented on a change in pull request #8654: [FLINK-12647][network] 
Add feature flag to disable release of consumed blocking partitions
URL: https://github.com/apache/flink/pull/8654#discussion_r293334200
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/ResultPartition.java
 ##########
 @@ -381,17 +383,20 @@ void onConsumedSubpartition(int subpartitionIndex) {
                        return;
                }
 
-               int refCnt = pendingReferences.decrementAndGet();
-
-               if (refCnt == 0) {
+               if (isManagedExternally) {
                        partitionManager.onConsumedPartition(this);
 
 Review comment:
   Maybe we could always `pin` as before, but migrate the checking logic from 
`ResultPartitionManger` to `ResultPartition` as I mentioned before. I mean 
`ResultPartitionManager` is not aware of the external issue, the tag in 
`ResultPartitionManager#isReleaseExternallyManagedPartitionsOnConsumption` 
could be merged with `ResultPartition#isManagedExternally` to generate a final 
tag in `ResultPartition`.
   
   Then while `ResultPartition#onConsumedSubpartition`, it could check the 
final tag to decide whether to call 
`ResultPartitionManager#onConsumedPartition`. And the reference counter only 
works when the final tag is false.

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