HuangZhenQiu commented on a change in pull request #11541: 
[FLINK-15416][network] add task manager netty client retry mechenism
URL: https://github.com/apache/flink/pull/11541#discussion_r406609362
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/PartitionRequestClientFactory.java
 ##########
 @@ -120,6 +127,40 @@ public void closeOpenChannelConnections(ConnectionID 
connectionId) {
                }
        }
 
+       void connectChannelWithRetry(ConnectingChannel connectingChannel, 
ConnectionID connectionId)
+               throws IOException, InterruptedException {
+               int count = 0;
+               Exception exception = null;
+               do {
+                       try {
+                               LOG.info("Connecting to {} at {} attempt", 
connectionId.getAddress(), count);
+                               
nettyClient.connect(connectionId.getAddress()).addListener(connectingChannel);
+
+                               NettyPartitionRequestClient client = 
connectingChannel.waitForChannel();
+
+                               clients.replace(connectionId, 
connectingChannel, client);
+                               exception = null;
 
 Review comment:
   Yes, it should return directly.

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

Reply via email to