nodece commented on code in PR #24387:
URL: https://github.com/apache/pulsar/pull/24387#discussion_r2194027482


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/PulsarServiceNameResolver.java:
##########
@@ -96,15 +131,143 @@ public void updateServiceUrl(String serviceUrl) throws 
InvalidServiceURL {
                 throw new InvalidServiceURL(e);
             }
         }
-        this.addressList = addresses;
+        this.allAddressList = addresses;
+        this.allAddressSet = new HashSet<>(addresses);

Review Comment:
   I think you should use `CopyOnWriteArraySet` instead of `HashSet` to ensure 
thread safety.
   



-- 
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: commits-unsubscr...@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to