abhilashmandaliya commented on a change in pull request #10028:
URL: https://github.com/apache/pulsar/pull/10028#discussion_r602109354



##########
File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/PulsarClientImpl.java
##########
@@ -689,11 +782,16 @@ public boolean isClosed() {
 
     @Override
     public synchronized void updateServiceUrl(String serviceUrl) throws 
PulsarClientException {
-        log.info("Updating service URL to {}", serviceUrl);
+        try {
+            log.info("Updating service URL to {}", serviceUrl);
 
-        conf.setServiceUrl(serviceUrl);
-        lookup.updateServiceUrl(serviceUrl);
-        cnxPool.closeAllConnections();
+            conf.setServiceUrl(serviceUrl);
+            lookup.updateServiceUrl(serviceUrl);
+            cnxPool.closeAllConnections();
+        } catch (Throwable t) {
+            log.warn("Failed to update service URL.");
+            close();

Review comment:
       @315157973  I didn't get you. Do you mean that failing to update the 
service URL will not stop the existing client and continue to work with the 
older service URL? If that is the case, then I can revert the changes to this 
method.




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


Reply via email to