Github user hanm commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/534#discussion_r201894799
  
    --- Diff: src/java/main/org/apache/zookeeper/client/StaticHostProvider.java 
---
    @@ -149,15 +185,12 @@ public 
StaticHostProvider(Collection<InetSocketAddress> serverAddresses,
          * @param currentHost the host to which this client is currently 
connected
          * @return true if changing connections is necessary for 
load-balancing, false otherwise  
          */
    -
    -
         @Override
         public synchronized boolean updateServerList(
                 Collection<InetSocketAddress> serverAddresses,
                 InetSocketAddress currentHost) {
    -        // Resolve server addresses and shuffle them
    -        List<InetSocketAddress> resolvedList = 
resolveAndShuffle(serverAddresses);
    -        if (resolvedList.isEmpty()) {
    +        List<InetSocketAddress> shuffledList = shuffle(serverAddresses);
    --- End diff --
    
    Thanks for quick update, @anmolnar ! 
    
    >> The built-in implementation treats them as different address
    
    That's what I am not sure about. If an unresolved address and a resolved 
address actually maps same address (after unresolved address gets resolved), 
should both be treated as same address (old behavior, via getHostString), 
instead of different address? 
    
    What I am thinking is to instead of using equal - use the old verbose code 
which will work (so far) for all combinations of comparing resolved and 
unresolved address. What do you think about this?


---

Reply via email to