akalash commented on a change in pull request #17238:
URL: https://github.com/apache/flink/pull/17238#discussion_r709985316



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/PartitionRequestServerHandler.java
##########
@@ -82,16 +82,17 @@ protected void channelRead0(ChannelHandlerContext ctx, 
NettyMessage msg) throws
 
                 LOG.debug("Read channel on {}: {}.", 
ctx.channel().localAddress(), request);
 
+                // Always register reader before requesting the subpartition 
in order to
+                // subsequent requests will be sure that PartitionRequest was 
received already
+                // even if subpartition view has not created yet.
+                NetworkSequenceViewReader reader =
+                        outboundQueue.notifyReaderCreated(
+                                new CreditBasedSequenceNumberingViewReader(
+                                        request.receiverId, request.credit, 
outboundQueue));

Review comment:
       Why is it a leak? If it never succeeds we just will be holding one 
reader for one subpartition until restart happens, so no leaks here.
   Just in case, notifyReaderCreated doesn't add a reader every time, it just 
holds the first one and ignores the others.




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