zentol 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_r293371822
##########
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:
I wouldn't be against introducing an additional ResultPartition class. It is
fairly straight-forward to do, and outright prevents anyone from interfering
with the refCounts if it is externally managed, which is quite useful.
----------------------------------------------------------------
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