HuangZhenQiu commented on a change in pull request #11541:
URL: https://github.com/apache/flink/pull/11541#discussion_r434978352
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/PartitionRequestClientFactory.java
##########
@@ -81,16 +92,12 @@ NettyPartitionRequestClient
createPartitionRequestClient(ConnectionID connection
Object old = clients.putIfAbsent(connectionId,
connectingChannel);
if (old == null) {
-
nettyClient.connect(connectionId.getAddress()).addListener(connectingChannel);
-
- client =
connectingChannel.waitForChannel();
-
- clients.replace(connectionId,
connectingChannel, client);
+
connectChannelWithRetry(connectingChannel, connectionId, true);
+ client = (NettyPartitionRequestClient)
clients.get(connectionId);
}
else if (old instanceof ConnectingChannel) {
- client = ((ConnectingChannel)
old).waitForChannel();
-
- clients.replace(connectionId, old,
client);
+
connectChannelWithRetry((ConnectingChannel) old, connectionId, false);
+ client = (NettyPartitionRequestClient)
clients.get(connectionId);
Review comment:
Yes, return client directly is better.
----------------------------------------------------------------
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]