PAC-MAJ commented on code in PR #1782:
URL: https://github.com/apache/zookeeper/pull/1782#discussion_r2653585682


##########
zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/Learner.java:
##########
@@ -410,8 +410,12 @@ private Socket connectToLeader() throws IOException, 
X509Exception, InterruptedE
             int remainingTimeout;
             long startNanoTime = nanoTime();
 
-            for (int tries = 0; tries < 5 && socket.get() == null; tries++) {
+            for (int tries = 0; tries < 5; tries++) {
                 try {
+                    sock = createSocket();
+                    if (socket.get() == null) {
+                        continue;

Review Comment:
   I have a small question if I may.
   Do we really want to "continue;" and skip the backoff delay 
leaderConnectDelayDuringRetryMs ?
   For the exceptions, it wasn't previously done neither but .close() with 
catch and swallow would do the trick in my opinion.



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