zjureel commented on code in PR #19380:
URL: https://github.com/apache/flink/pull/19380#discussion_r974068347


##########
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/ResultPartitionManager.java:
##########
@@ -79,8 +128,47 @@ public ResultSubpartitionView createSubpartitionView(
         return subpartitionView;
     }
 
+    @Override
+    public ResultSubpartitionView createSubpartitionViewOrNotify(
+            ResultPartitionID partitionId,
+            int subpartitionIndex,
+            BufferAvailabilityListener availabilityListener,
+            PartitionRequestNotifier notifier) throws IOException {
+
+        final ResultSubpartitionView subpartitionView;
+        synchronized (registeredPartitions) {
+            final ResultPartition partition = 
registeredPartitions.get(partitionId);
+
+            if (partition == null) {
+                requestPartitionNotifiers.computeIfAbsent(partitionId, key -> 
new InputRequestNotifierManager()).addNotifier(notifier);
+                return null;
+            }
+
+            LOG.debug("Requesting subpartition {} of {}.", subpartitionIndex, 
partition);
+
+            subpartitionView =
+                    partition.createSubpartitionView(subpartitionIndex, 
availabilityListener);
+        }
+
+        return subpartitionView;
+    }
+
+    @Override
+    public void releasePartitionRequestNotifier(NettyPartitionRequestNotifier 
notifier) {

Review Comment:
   We remove the instance from `ResultPartitionManager` here, and the behavior 
of reader will be consistent with the original in 
`CreditBasedSequenceNumberingViewReader.releaseAllResources`



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to