lhotari commented on code in PR #25929:
URL: https://github.com/apache/pulsar/pull/25929#discussion_r3391755376


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConnectionHandler.java:
##########
@@ -189,7 +205,15 @@ void reconnectLater(Throwable exception) {
         if (state.changeToConnecting()) {
             state.client.timer().newTimeout(timeout -> {
                 log.info("Reconnecting after connection was closed");
-                grabCnx();
+                // Re-dial the explicit leader target (v5 TC discovery) if 
set; otherwise the normal
+                // lookup path. Without this, a first-attempt failure during 
failover would fall back
+                // to the service URL and never reach the partition's new 
leader.
+                URI target = explicitHostURI;
+                if (target != null) {
+                    grabCnx(Optional.of(target));

Review Comment:
   just wondering what happens when the target broker goes down? does the retry 
loop exit?



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