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

    https://github.com/apache/zookeeper/pull/534#discussion_r192694788
  
    --- Diff: src/java/main/org/apache/zookeeper/client/StaticHostProvider.java 
---
    @@ -314,7 +340,7 @@ public InetSocketAddress next(long spinDelay) {
                     addr = nextHostInReconfigMode();
                     if (addr != null) {
                        currentIndex = serverAddresses.indexOf(addr);
    -                   return addr;                
    +                   return resolve(addr);
    --- End diff --
    
    I disagree. We should not do any caching in our codebase, because there're 
multiple levels of caching already present in DNS infrastructure, like JVM 
caching, os-level caching, DNS servers caching, etc. `resolve()` will 
eventually become a no-op if any of these caches find a hit.


---

Reply via email to