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

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/ResultPartition.java
 ##########
 @@ -381,13 +386,15 @@ void onConsumedSubpartition(int subpartitionIndex) {
                        return;
                }
 
-               int refCnt = pendingReferences.decrementAndGet();
+               // externally managed partitions are released on-demand and do 
not use ref-counting
+               if (!isManagedExternally) {
+                       int refCnt = pendingReferences.decrementAndGet();
 
-               if (refCnt == 0) {
-                       partitionManager.onConsumedPartition(this);
-               }
-               else if (refCnt < 0) {
-                       throw new IllegalStateException("All references 
released.");
+                       if (refCnt == 0) {
+                               partitionManager.onConsumedPartition(this);
+                       } else if (refCnt < 0) {
+                               throw new IllegalStateException("All references 
released.");
+                       }
 
 Review comment:
   Looking at the changes to the `ResultPartition` I'm was wondering whether it 
wouldn't make sense to have a `ReleaseOnConsumptionResultPartition` 
implementation which extends `ResultPartition`. Now we are mixing the logic for 
the implicit and explicit release in one class.

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