Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GEODE-9666: Avoid caching InetSocketAddress (apache#6938)
The changes for GEODE-9139 changed the behavior of org.apache.geode.distributed.internal.tcpserver.HostAndPort to permanently cache the internal InetSocketAddress once it has tried one time to resolve the address. This undoes part of the fix introduced by GEODE-7808, in which HostAndPort was created as a way to hold an unresolved hostname. The issue is that the cached InetSocketAddress may contain a stale or unresolved address which will be returned by getSocketInetAddress for the lifetime of the HostAndPort/InetSocketWrapper object. This prevents the address from being resolved correctly after changes in DNS records. (Such changes are common in cloud environments.) This commit removes the cached internal InetSocketAddress from InetSocketWrapper so that getSocketInetAddress will try to resolve the address each time it is called with an unresolved address.
- Loading branch information