KarmaGYZ commented on a change in pull request #18417:
URL: https://github.com/apache/flink/pull/18417#discussion_r805648663



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/NettyPartitionRequestClient.java
##########
@@ -222,22 +227,33 @@ public void close(RemoteInputChannel inputChannel) throws 
IOException {
 
         clientHandler.removeInputChannel(inputChannel);
 
-        if (closeReferenceCounter.decrement()) {
-            // Close the TCP connection. Send a close request msg to ensure
-            // that outstanding backwards task events are not discarded.
-            tcpChannel
-                    .writeAndFlush(new NettyMessage.CloseRequest())
-                    .addListener(ChannelFutureListener.CLOSE_ON_FAILURE);
-
-            // Make sure to remove the client from the factory
-            clientFactory.destroyPartitionRequestClient(connectionId, this);
+        if (closeReferenceCounter.getAndUpdate(count -> count > 0 ? count - 1 
: count) == 1
+                && !canBeReused()) {

Review comment:
       I don't think so. We close the connection only the first time the 
counter reaches zero.




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