geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hiteshkhame...@apache.org
Subject [50/50] [abbrv] geode git commit: GEODE-2804 Caching the InetAddress for configured ip string
Date Tue, 27 Jun 2017 19:55:55 GMT
 GEODE-2804 Caching the InetAddress for configured ip string

    1. We keep configure host string in HostAddress class
    2. We reuse InetsocketAddress if it is ipString.
    3. Client has logic to retry thus we keep InetsocketAddress even if
       it is not ip string.

    GEODE-3017 IPv6 issue on windows. Above changes fixed this issue.

    GEODE-2940 Now we don't validate configure host string on start. As
    there is possibility that host may not available.

    1. Earlier wan config were failing because of that. Now we just keep
    those configure host string. And try this later.

    Added unit tests for it.


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/ea8840fc
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/ea8840fc
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/ea8840fc

Branch: refs/heads/feature/GEODE-2804v3
Commit: ea8840fc98c794e58f380fb6a82f1002f195152e
Parents: 3a46b79
Author: Hitesh Khamesra <hkhamesra@pivotal.io>
Authored: Tue Jun 27 12:51:12 2017 -0700
Committer: Hitesh Khamesra <hkhamesra@pivotal.io>
Committed: Tue Jun 27 12:54:17 2017 -0700

----------------------------------------------------------------------
 geode-assembly/build.gradle                     |   1 +
 .../src/test/resources/expected_jars.txt        |   3 +-
 geode-core/build.gradle                         |   3 +
 .../admin/internal/DistributionLocatorImpl.java |   6 +-
 .../internal/AutoConnectionSourceImpl.java      | 133 +++++++++++--------
 .../geode/cache/client/internal/PoolImpl.java   |  15 ++-
 .../internal/AbstractDistributionConfig.java    |   8 +-
 .../internal/InternalDistributedSystem.java     |   6 +-
 .../internal/membership/gms/GMSUtil.java        |  11 +-
 .../membership/gms/locator/GMSLocator.java      |   9 +-
 .../membership/gms/membership/GMSJoinLeave.java |   8 +-
 .../membership/gms/membership/HostAddress.java  | 118 ++++++++++++++++
 .../internal/tcpserver/TcpClient.java           |   3 +-
 .../admin/remote/DistributionLocatorId.java     |  45 +++++--
 .../admin/remote/RemoteTransportConfig.java     |   5 +-
 .../cache/ClusterConfigurationLoader.java       |   2 +-
 .../geode/internal/cache/PoolFactoryImpl.java   |  30 +++--
 .../internal/AutoConnectionSourceDUnitTest.java |  12 +-
 .../AutoConnectionSourceImplJUnitTest.java      |  84 ++++++++++--
 .../internal/DistributionConfigJUnitTest.java   |   2 +-
 .../internal/StartupMessageDataJUnitTest.java   |   4 +-
 .../gms/membership/GMSJoinLeaveJUnitTest.java   |   1 +
 .../geode/codeAnalysis/excludedClasses.txt      |   3 +-
 .../internal/locator/wan/LocatorDiscovery.java  |  10 +-
 .../wan/LocatorMembershipListenerImpl.java      |   8 +-
 .../cache/wan/AbstractRemoteGatewaySender.java  |   4 +-
 .../wan/misc/WanAutoDiscoveryDUnitTest.java     |   7 +-
 gradle/dependency-versions.properties           |   1 +
 28 files changed, 403 insertions(+), 139 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/ea8840fc/geode-assembly/build.gradle
----------------------------------------------------------------------
diff --git a/geode-assembly/build.gradle b/geode-assembly/build.gradle
index 39bb542..95ccc70 100755
--- a/geode-assembly/build.gradle
+++ b/geode-assembly/build.gradle
@@ -140,6 +140,7 @@ def cp = {
         it.contains('commons-collections') ||
         it.contains('commons-lang') ||
         it.contains('commons-logging') ||
+        it.contains('commons-validator') ||        
         it.contains('fast-classpath-scanner') ||
         it.contains('fastutil') ||
         it.contains('jackson-annotations') ||

http://git-wip-us.apache.org/repos/asf/geode/blob/ea8840fc/geode-assembly/src/test/resources/expected_jars.txt
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/resources/expected_jars.txt b/geode-assembly/src/test/resources/expected_jars.txt
index 6260167..b0e7154 100644
--- a/geode-assembly/src/test/resources/expected_jars.txt
+++ b/geode-assembly/src/test/resources/expected_jars.txt
@@ -85,4 +85,5 @@ springfox-spring-web
 springfox-swagger
 springfox-swagger-common
 springfox-swagger-ui
-swagger-models
\ No newline at end of file
+swagger-models
+commons-validator

http://git-wip-us.apache.org/repos/asf/geode/blob/ea8840fc/geode-core/build.gradle
----------------------------------------------------------------------
diff --git a/geode-core/build.gradle b/geode-core/build.gradle
index 7f34b4a..9ecb0f9 100755
--- a/geode-core/build.gradle
+++ b/geode-core/build.gradle
@@ -39,6 +39,8 @@ dependencies {
   compile 'antlr:antlr:' + project.'antlr.version'
   compile 'com.fasterxml.jackson.core:jackson-databind:' + project.'jackson.version'
   compile 'commons-io:commons-io:' + project.'commons-io.version'
+  compile 'commons-validator:commons-validator:' + project.'commons-validator.version'
+
   compile 'commons-lang:commons-lang:' + project.'commons-lang.version'
   compile ('commons-modeler:commons-modeler:' + project.'commons-modeler.version') {
     exclude module: 'commons-digester'
@@ -133,6 +135,7 @@ dependencies {
   testRuntime 'commons-collections:commons-collections:' + project.'commons-collections.version'
   testRuntime 'commons-configuration:commons-configuration:' + project.'commons-configuration.version'
   testRuntime 'commons-io:commons-io:' + project.'commons-io.version'
+  testRuntime 'commons-validator:commons-validator:' + project.'commons-validator.version'
   testCompile 'net.spy:spymemcached:' + project.'spymemcached.version'
   testCompile 'redis.clients:jedis:' + project.'jedis.version'
 

http://git-wip-us.apache.org/repos/asf/geode/blob/ea8840fc/geode-core/src/main/java/org/apache/geode/admin/internal/DistributionLocatorImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/DistributionLocatorImpl.java b/geode-core/src/main/java/org/apache/geode/admin/internal/DistributionLocatorImpl.java
index c1bfc93..97c5c7d 100755
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/DistributionLocatorImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/admin/internal/DistributionLocatorImpl.java
@@ -193,14 +193,14 @@ public class DistributionLocatorImpl implements DistributionLocator, InternalMan
       for (Iterator<String> locatorIter =
           hostedLocators.get(memberIter.next()).iterator(); locatorIter.hasNext();) {
         DistributionLocatorId locator = new DistributionLocatorId(locatorIter.next());
-        found = found || locator.getHost().getHostAddress().equals(host);
-        found = found || locator.getHost().getHostName().equals(host);
+        found = found || locator.getHostName().equals(host);
         if (!found && !host.contains(".")) {
           try {
             InetAddress inetAddr = InetAddress.getByName(host);
             found = locator.getHost().getHostName().equals(inetAddr.getHostName());
             if (!found) {
-              found = locator.getHost().getHostAddress().equals(inetAddr.getHostAddress());
+              found =
+                  locator.getHost().getAddress().getHostAddress().equals(inetAddr.getHostAddress());
             }
           } catch (UnknownHostException e) {
             // try config host as if it is an IP address instead of host name

http://git-wip-us.apache.org/repos/asf/geode/blob/ea8840fc/geode-core/src/main/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImpl.java b/geode-core/src/main/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImpl.java
index 070451c..7bf9f23 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImpl.java
@@ -49,6 +49,7 @@ import org.apache.geode.cache.client.internal.locator.ServerLocationRequest;
 import org.apache.geode.cache.client.internal.locator.ServerLocationResponse;
 import org.apache.geode.distributed.internal.DistributionConfig;
 import org.apache.geode.distributed.internal.ServerLocation;
+import org.apache.geode.distributed.internal.membership.gms.membership.HostAddress;
 import org.apache.geode.distributed.internal.tcpserver.TcpClient;
 import org.apache.geode.internal.cache.tier.sockets.ClientProxyMembershipID;
 import org.apache.geode.internal.i18n.LocalizedStrings;
@@ -69,9 +70,11 @@ public class AutoConnectionSourceImpl implements ConnectionSource {
   private TcpClient tcpClient;
 
   protected static final LocatorListRequest LOCATOR_LIST_REQUEST = new LocatorListRequest();
-  private static final Comparator<InetSocketAddress> SOCKET_ADDRESS_COMPARATOR =
-      new Comparator<InetSocketAddress>() {
-        public int compare(InetSocketAddress o1, InetSocketAddress o2) {
+  private static final Comparator<HostAddress> SOCKET_ADDRESS_COMPARATOR =
+      new Comparator<HostAddress>() {
+        public int compare(HostAddress la1, HostAddress la2) {
+          InetSocketAddress o1 = la1.getSocketInetAddress();
+          InetSocketAddress o2 = la2.getSocketInetAddress();
           // shouldn't happen, but if it does we'll say they're the same.
           if (o1.getAddress() == null || o2.getAddress() == null) {
             return 0;
@@ -87,7 +90,7 @@ public class AutoConnectionSourceImpl implements ConnectionSource {
             return o1.getPort() - o2.getPort();
         }
       };
-  protected final List<InetSocketAddress> initialLocators;
+  protected final List<HostAddress> initialLocators;
   private final String serverGroup;
   private AtomicReference<LocatorList> locators = new AtomicReference<LocatorList>();
   private AtomicReference<LocatorList> onlineLocators = new AtomicReference<LocatorList>();
@@ -108,12 +111,18 @@ public class AutoConnectionSourceImpl implements ConnectionSource {
    * @param serverGroup
    * @param handshakeTimeout
    */
-  public AutoConnectionSourceImpl(List<InetSocketAddress> contacts, String serverGroup,
-      int handshakeTimeout) {
-    ArrayList<InetSocketAddress> tmpContacts = new ArrayList<InetSocketAddress>(contacts);
+  public AutoConnectionSourceImpl(List<InetSocketAddress> locators, List<HostAddress> contacts,
+      String serverGroup, int handshakeTimeout) {
+    /*
+     * if (contacts == null || contacts.size() == 0) { contacts = new ArrayList<>(); for
+     * (InetSocketAddress l : locators) { LocatorAddress la = new LocatorAddress(l,
+     * l.getHostName()); contacts.add(la); } }
+     */
+    ArrayList<HostAddress> tmpContacts =
+        new ArrayList<HostAddress>(Collections.unmodifiableList(contacts));
     this.locators.set(new LocatorList(tmpContacts));
     this.onlineLocators.set(new LocatorList(Collections.emptyList()));
-    this.initialLocators = Collections.unmodifiableList(tmpContacts);
+    this.initialLocators = Collections.unmodifiableList(this.locators.get().getLocatorAddresses());
     this.connectionTimeout = handshakeTimeout;
     this.serverGroup = serverGroup;
     this.tcpClient = new TcpClient();
@@ -202,20 +211,21 @@ public class AutoConnectionSourceImpl implements ConnectionSource {
   }
 
 
-  private ServerLocationResponse queryOneLocator(InetSocketAddress locator,
+  private ServerLocationResponse queryOneLocator(HostAddress locator,
       ServerLocationRequest request) {
     Object returnObj = null;
     try {
       pool.getStats().incLocatorRequests();
-      returnObj = tcpClient.requestToServer(locator, request, connectionTimeout, true);
+      returnObj = tcpClient.requestToServer(locator.getSocketInetAddressC(), request,
+          connectionTimeout, true);
       ServerLocationResponse response = (ServerLocationResponse) returnObj;
       pool.getStats().incLocatorResponses();
       if (response != null) {
-        reportLiveLocator(locator);
+        reportLiveLocator(locator.getSocketInetAddressC());
       }
       return response;
     } catch (IOException ioe) {
-      reportDeadLocator(locator, ioe);
+      reportDeadLocator(locator.getSocketInetAddressC(), ioe);
       updateLocatorInLocatorList(locator);
       return null;
     } catch (ClassNotFoundException e) {
@@ -228,7 +238,7 @@ public class AutoConnectionSourceImpl implements ConnectionSource {
       if (logger.isDebugEnabled()) {
         logger.debug("Received odd response object from the locator: {}", returnObj);
       }
-      reportDeadLocator(locator, e);
+      reportDeadLocator(locator.getSocketInetAddressC(), e);
       return null;
     }
   }
@@ -240,19 +250,20 @@ public class AutoConnectionSourceImpl implements ConnectionSource {
    * 
    * @param locator
    */
-  protected void updateLocatorInLocatorList(InetSocketAddress locator) {
-    if (locator.getHostName() != null) {
+  protected void updateLocatorInLocatorList(HostAddress locator) {
+    if (locator.getSocketInetAddressC().getHostName() != null && !locator.isIpString()) {
       LocatorList locatorList = locators.get();
-      List<InetSocketAddress> newLocatorsList = new ArrayList<>();
+      List<HostAddress> newLocatorsList = new ArrayList<>();
 
-      for (InetSocketAddress tloc : locatorList.getLocators()) {
+      for (HostAddress tloc : locatorList.getLocatorAddresses()) {
         if (tloc.equals(locator)) {
           /**
            * This call doesn't throw UnknownHostException;
            */
-          InetSocketAddress changeLoc =
-              new InetSocketAddress(locator.getHostName(), locator.getPort());
-          newLocatorsList.add(changeLoc);
+          InetSocketAddress changeLoc = new InetSocketAddress(locator.getHostName(),
+              locator.getSocketInetAddressC().getPort());
+          HostAddress la = new HostAddress(changeLoc, locator.getHostName());
+          newLocatorsList.add(la);
           logger.info("updateLocatorInLocatorList changing locator list: loc form: " + locator
               + " ,loc to: " + changeLoc);
         } else {
@@ -269,7 +280,7 @@ public class AutoConnectionSourceImpl implements ConnectionSource {
   }
 
   protected List<InetSocketAddress> getCurrentLocators() {
-    return locators.get().locators;
+    return locators.get().getLocators();
   }
 
   protected ServerLocationResponse queryLocators(ServerLocationRequest request) {
@@ -278,13 +289,13 @@ public class AutoConnectionSourceImpl implements ConnectionSource {
 
     final boolean isDebugEnabled = logger.isDebugEnabled();
     do {
-      InetSocketAddress locator = (InetSocketAddress) controllerItr.next();
+      HostAddress la = (HostAddress) controllerItr.next();
       if (isDebugEnabled) {
-        logger.debug("Sending query to locator {}: {}", locator, request);
+        logger.debug("Sending query to locator {}: {}", la, request);
       }
-      response = queryOneLocator(locator, request);
+      response = queryOneLocator(la, request);
       if (isDebugEnabled) {
-        logger.debug("Received query response from locator {}: {}", locator, response);
+        logger.debug("Received query response from locator {}: {}", la, response);
       }
     } while (controllerItr.hasNext() && (response == null || !response.hasResult()));
 
@@ -301,28 +312,31 @@ public class AutoConnectionSourceImpl implements ConnectionSource {
     isBalanced = response.isBalanced();
     List<ServerLocation> locatorResponse = response.getLocators();
 
-    List<InetSocketAddress> newLocators = new ArrayList<InetSocketAddress>(locatorResponse.size());
-    List<InetSocketAddress> newOnlineLocators =
-        new ArrayList<InetSocketAddress>(locatorResponse.size());
+    List<HostAddress> newLocatorAddresses = new ArrayList<HostAddress>(locatorResponse.size());
+    List<HostAddress> newOnlineLocators = new ArrayList<>(locatorResponse.size());
 
-    Set<InetSocketAddress> badLocators = new HashSet<InetSocketAddress>(initialLocators);
+    Set<HostAddress> badLocators = new HashSet<>(initialLocators);
     for (Iterator<ServerLocation> itr = locatorResponse.iterator(); itr.hasNext();) {
       ServerLocation locator = itr.next();
       InetSocketAddress address = new InetSocketAddress(locator.getHostName(), locator.getPort());
-      newLocators.add(address);
-      newOnlineLocators.add(address);
-      badLocators.remove(address);
+      HostAddress la = new HostAddress(address, locator.getHostName());
+      newLocatorAddresses.add(la);
+      newOnlineLocators.add(la);
+      badLocators.remove(la);
     }
 
-    addbadLocators(newLocators, badLocators);
+    addbadLocators(newLocatorAddresses, badLocators);
+
+    LocatorList newLocatorList = new LocatorList(newLocatorAddresses);
 
     if (logger.isInfoEnabled()) {
+      List<InetSocketAddress> newLocators = newLocatorList.getLocators();
       LocatorList oldLocators = (LocatorList) locators.get();
       ArrayList<InetSocketAddress> removedLocators =
           new ArrayList<InetSocketAddress>(oldLocators.getLocators());
       removedLocators.removeAll(newLocators);
 
-      ArrayList<InetSocketAddress> addedLocators = new ArrayList<InetSocketAddress>(newLocators);
+      ArrayList<InetSocketAddress> addedLocators = new ArrayList<>(newLocators);
       addedLocators.removeAll(oldLocators.getLocators());
       if (!addedLocators.isEmpty()) {
         locatorCallback.locatorsDiscovered(Collections.unmodifiableList(addedLocators));
@@ -337,34 +351,33 @@ public class AutoConnectionSourceImpl implements ConnectionSource {
             removedLocators));
       }
     }
-    LocatorList newLocatorList = new LocatorList(newLocators);
+
+
 
     locators.set(newLocatorList);
     onlineLocators.set(new LocatorList(newOnlineLocators));
-    pool.getStats().setLocatorCount(newLocators.size());
+    pool.getStats().setLocatorCount(newLocatorAddresses.size());
   }
 
   /**
    * This method will add bad locator only when locator with hostname and port is not already in
    * list.
    */
-  protected void addbadLocators(List<InetSocketAddress> newLocators,
-      Set<InetSocketAddress> badLocators) {
-    for (InetSocketAddress badLoc : badLocators) {
+  protected void addbadLocators(List<HostAddress> newLocators, Set<HostAddress> badLocators) {
+    for (HostAddress badloc : badLocators) {
       boolean addIt = true;
-      for (InetSocketAddress goodloc : newLocators) {
-        boolean isSameHost = badLoc.getHostName().equals(goodloc.getHostName());
-        if (isSameHost) {
-          boolean isSamePort = badLoc.getPort() == goodloc.getPort();
-          if (isSamePort) {
-            // ip has been changed so don't add this in current list
-            addIt = false;
-            break;
-          }
+      for (HostAddress goodloc : newLocators) {
+        boolean isSameHost = badloc.getHostName().equals(goodloc.getHostName());
+        if (isSameHost && badloc.getPort() == goodloc.getPort()) {
+          // ip has been changed so don't add this in current
+          // list
+          addIt = false;
+          break;
+
         }
       }
       if (addIt) {
-        newLocators.add(badLoc);
+        newLocators.add(badloc);
       }
     }
   }
@@ -423,15 +436,23 @@ public class AutoConnectionSourceImpl implements ConnectionSource {
    * A list of locators, which remembers the last known good locator.
    */
   private static class LocatorList {
-    protected final List<InetSocketAddress> locators;
+    protected final List<HostAddress> locators;
     protected AtomicInteger currentLocatorIndex = new AtomicInteger();
 
-    public LocatorList(List<InetSocketAddress> locators) {
+    public LocatorList(List<HostAddress> locators) {
       Collections.sort(locators, SOCKET_ADDRESS_COMPARATOR);
       this.locators = Collections.unmodifiableList(locators);
     }
 
-    public Collection<InetSocketAddress> getLocators() {
+    public List<InetSocketAddress> getLocators() {
+      List<InetSocketAddress> locs = new ArrayList<>();
+      for (HostAddress la : locators) {
+        locs.add(la.getSocketInetAddress());
+      }
+      return locs;
+    }
+
+    public List<HostAddress> getLocatorAddresses() {
       return locators;
     }
 
@@ -439,7 +460,7 @@ public class AutoConnectionSourceImpl implements ConnectionSource {
       return locators.size();
     }
 
-    public Iterator<InetSocketAddress> iterator() {
+    public Iterator<HostAddress> iterator() {
       return new LocatorIterator();
     }
 
@@ -454,7 +475,7 @@ public class AutoConnectionSourceImpl implements ConnectionSource {
      * controller.
      * 
      */
-    protected class LocatorIterator implements Iterator<InetSocketAddress> {
+    protected class LocatorIterator implements Iterator<HostAddress> {
       private int startLocator = currentLocatorIndex.get();
       private int locatorNum = 0;
 
@@ -462,12 +483,12 @@ public class AutoConnectionSourceImpl implements ConnectionSource {
         return locatorNum < locators.size();
       }
 
-      public InetSocketAddress next() {
+      public HostAddress next() {
         if (!hasNext()) {
           return null;
         } else {
           int index = (locatorNum + startLocator) % locators.size();
-          InetSocketAddress nextLocator = locators.get(index);
+          HostAddress nextLocator = locators.get(index);
           currentLocatorIndex.set(index);
           locatorNum++;
           return nextLocator;

http://git-wip-us.apache.org/repos/asf/geode/blob/ea8840fc/geode-core/src/main/java/org/apache/geode/cache/client/internal/PoolImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/client/internal/PoolImpl.java b/geode-core/src/main/java/org/apache/geode/cache/client/internal/PoolImpl.java
index 3ded54a..332046d 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/client/internal/PoolImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/client/internal/PoolImpl.java
@@ -55,6 +55,7 @@ import org.apache.geode.distributed.PoolCancelledException;
 import org.apache.geode.distributed.internal.DistributionConfig;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.distributed.internal.ServerLocation;
+import org.apache.geode.distributed.internal.membership.gms.membership.HostAddress;
 import org.apache.geode.internal.ScheduledThreadPoolExecutorWithKeepAlive;
 import org.apache.geode.internal.admin.ClientStatsManager;
 import org.apache.geode.internal.cache.EventID;
@@ -111,6 +112,7 @@ public class PoolImpl implements InternalPool {
   private final int subscriptionMessageTrackingTimeout;
   private final int subscriptionAckInterval;
   private final String serverGroup;
+  private final List<HostAddress> locatorAddresses;
   private final List<InetSocketAddress> locators;
   private final List<InetSocketAddress> servers;
   private final boolean startDisabled;
@@ -151,8 +153,9 @@ public class PoolImpl implements InternalPool {
   public static final int PRIMARY_QUEUE_TIMED_OUT = -1;
   private AtomicInteger primaryQueueSize = new AtomicInteger(PRIMARY_QUEUE_NOT_AVAILABLE);
 
-  public static PoolImpl create(PoolManagerImpl pm, String name, Pool attributes) {
-    PoolImpl pool = new PoolImpl(pm, name, attributes);
+  public static PoolImpl create(PoolManagerImpl pm, String name, Pool attributes,
+      List<HostAddress> locatorAddresses) {
+    PoolImpl pool = new PoolImpl(pm, name, attributes, locatorAddresses);
     pool.finishCreate(pm);
     return pool;
   }
@@ -178,7 +181,8 @@ public class PoolImpl implements InternalPool {
     }
   }
 
-  protected PoolImpl(PoolManagerImpl pm, String name, Pool attributes) {
+  protected PoolImpl(PoolManagerImpl pm, String name, Pool attributes,
+      List<HostAddress> locAddresses) {
     this.pm = pm;
     this.name = name;
     this.socketConnectTimeout = attributes.getSocketConnectTimeout();
@@ -200,6 +204,7 @@ public class PoolImpl implements InternalPool {
     this.subscriptionAckInterval = attributes.getSubscriptionAckInterval();
     this.serverGroup = attributes.getServerGroup();
     this.multiuserSecureModeEnabled = attributes.getMultiuserAuthentication();
+    this.locatorAddresses = locAddresses;
     this.locators = attributes.getLocators();
     this.servers = attributes.getServers();
     this.startDisabled =
@@ -643,8 +648,8 @@ public class PoolImpl implements InternalPool {
     if (locators.isEmpty()) {
       return new ExplicitConnectionSourceImpl(getServers());
     } else {
-      AutoConnectionSourceImpl source =
-          new AutoConnectionSourceImpl(locators, getServerGroup(), socketConnectTimeout);
+      AutoConnectionSourceImpl source = new AutoConnectionSourceImpl(locators, locatorAddresses,
+          getServerGroup(), socketConnectTimeout);
       if (locatorDiscoveryCallback != null) {
         source.setLocatorDiscoveryCallback(locatorDiscoveryCallback);
       }

http://git-wip-us.apache.org/repos/asf/geode/blob/ea8840fc/geode-core/src/main/java/org/apache/geode/distributed/internal/AbstractDistributionConfig.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/AbstractDistributionConfig.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/AbstractDistributionConfig.java
index 01c6157..795f6a5 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/AbstractDistributionConfig.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/AbstractDistributionConfig.java
@@ -24,11 +24,13 @@ import org.apache.geode.internal.AbstractConfig;
 import org.apache.geode.internal.ConfigSource;
 import org.apache.geode.internal.admin.remote.DistributionLocatorId;
 import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.internal.logging.LogWriterImpl;
 import org.apache.geode.internal.logging.log4j.LogLevel;
 import org.apache.geode.internal.net.SocketCreator;
 import org.apache.geode.internal.security.SecurableCommunicationChannel;
 import org.apache.geode.memcached.GemFireMemcachedServer;
+import org.apache.logging.log4j.Logger;
 
 import java.lang.reflect.Method;
 import java.net.InetAddress;
@@ -54,6 +56,8 @@ import java.util.StringTokenizer;
 public abstract class AbstractDistributionConfig extends AbstractConfig
     implements DistributionConfig {
 
+  private static final Logger logger = LogService.getLogger();
+
   protected Object checkAttribute(String attName, Object value) {
     // first check to see if this attribute is modifiable, this also checks if the attribute is a
     // valid one.
@@ -274,9 +278,7 @@ public abstract class AbstractDistributionConfig extends AbstractConfig
         hostAddress = InetAddress.getByName(host);
 
       } catch (UnknownHostException ex) {
-        throw new IllegalArgumentException(
-            LocalizedStrings.AbstractDistributionConfig_UNKNOWN_LOCATOR_HOST_0
-                .toLocalizedString(host));
+        logger.warn("Unknown locator host: " + host);
       }
 
       locatorsb.append(host);

http://git-wip-us.apache.org/repos/asf/geode/blob/ea8840fc/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
index a4b3a50..6aa602f 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
@@ -845,8 +845,8 @@ public class InternalDistributedSystem extends DistributedSystem
                                                                                      // Appenders
               this.securityLogWriter, // LOG: this is after IDS has created LogWriterLoggers and
                                       // Appenders
-              locId.getHost(), locId.getHostnameForClients(), this.originalConfig.toProperties(),
-              false);
+              locId.getHost().getAddress(), locId.getHostnameForClients(),
+              this.originalConfig.toProperties(), false);
 
       // if locator is started this way, cluster config is not enabled, set the flag correctly
       this.startedLocator.getConfig().setEnableClusterConfiguration(false);
@@ -1595,7 +1595,7 @@ public class InternalDistributedSystem extends DistributedSystem
       if (addr != null && addr.trim().length() > 0) {
         canonical.append(addr);
       } else {
-        canonical.append(locId.getHost().getHostAddress());
+        canonical.append(locId.getHostName());
       }
       canonical.append("[");
       canonical.append(String.valueOf(locId.getPort()));

http://git-wip-us.apache.org/repos/asf/geode/blob/ea8840fc/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSUtil.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSUtil.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSUtil.java
index da295ab..9f3126a 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSUtil.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSUtil.java
@@ -24,6 +24,7 @@ import java.util.StringTokenizer;
 import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.GemFireConfigException;
+import org.apache.geode.distributed.internal.membership.gms.membership.HostAddress;
 import org.apache.geode.internal.net.SocketCreator;
 
 public class GMSUtil {
@@ -35,7 +36,7 @@ public class GMSUtil {
    * @param bindAddress optional address to check for loopback compatibility
    * @return addresses of locators
    */
-  public static List<InetSocketAddress> parseLocators(String locatorsString, String bindAddress) {
+  public static List<HostAddress> parseLocators(String locatorsString, String bindAddress) {
     InetAddress addr = null;
 
     try {
@@ -57,9 +58,8 @@ public class GMSUtil {
    * @param bindAddress optional address to check for loopback compatibility
    * @return addresses of locators
    */
-  public static List<InetSocketAddress> parseLocators(String locatorsString,
-      InetAddress bindAddress) {
-    List<InetSocketAddress> result = new ArrayList<>(2);
+  public static List<HostAddress> parseLocators(String locatorsString, InetAddress bindAddress) {
+    List<HostAddress> result = new ArrayList<>(2);
     String host;
     int port;
     boolean checkLoopback = (bindAddress != null);
@@ -95,7 +95,8 @@ public class GMSUtil {
                     + ").  On Unix this usually means that /etc/hosts is misconfigured.");
           }
         }
-        result.add(isa);
+        HostAddress la = new HostAddress(isa, host);
+        result.add(la);
       } catch (NumberFormatException e) {
         // this shouldn't happen because the config has already been parsed and
         // validated

http://git-wip-us.apache.org/repos/asf/geode/blob/ea8840fc/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/locator/GMSLocator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/locator/GMSLocator.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/locator/GMSLocator.java
index aff1938..6c7af90 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/locator/GMSLocator.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/locator/GMSLocator.java
@@ -51,6 +51,7 @@ import org.apache.geode.distributed.internal.membership.gms.GMSUtil;
 import org.apache.geode.distributed.internal.membership.gms.NetLocator;
 import org.apache.geode.distributed.internal.membership.gms.Services;
 import org.apache.geode.distributed.internal.membership.gms.interfaces.Locator;
+import org.apache.geode.distributed.internal.membership.gms.membership.HostAddress;
 import org.apache.geode.distributed.internal.membership.gms.mgr.GMSMembershipManager;
 import org.apache.geode.distributed.internal.tcpserver.TcpClient;
 import org.apache.geode.distributed.internal.tcpserver.TcpServer;
@@ -70,7 +71,7 @@ public class GMSLocator implements Locator, NetLocator {
   private final boolean networkPartitionDetectionEnabled;
   private final String securityUDPDHAlgo;
   private final String locatorString;
-  private final List<InetSocketAddress> locators;
+  private final List<HostAddress> locators;
   private Services services;
   private final LocatorStats stats;
   private InternalDistributedMember localAddress;
@@ -106,7 +107,7 @@ public class GMSLocator implements Locator, NetLocator {
     this.securityUDPDHAlgo = securityUDPDHAlgo;
     this.locatorString = locatorString;
     if (this.locatorString == null || this.locatorString.length() == 0) {
-      this.locators = new ArrayList<>(0);
+      this.locators = new ArrayList<HostAddress>(0);
     } else {
       this.locators = GMSUtil.parseLocators(locatorString, bindAddress);
     }
@@ -387,8 +388,8 @@ public class GMSLocator implements Locator, NetLocator {
   }
 
   private boolean recoverFromOthers() {
-    for (InetSocketAddress other : this.locators) {
-      if (recover(other)) {
+    for (HostAddress other : this.locators) {
+      if (recover(other.getSocketInetAddress())) {
         logger.info("Peer locator recovered state from " + other);
         return true;
       }

http://git-wip-us.apache.org/repos/asf/geode/blob/ea8840fc/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java
index 93c5bf8..56e2662 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java
@@ -184,7 +184,7 @@ public class GMSJoinLeave implements JoinLeave, MessageHandler {
    */
   private NetView lastConflictingView;
 
-  private List<InetSocketAddress> locators;
+  private List<HostAddress> locators;
 
   /**
    * a list of join/leave/crashes
@@ -1098,8 +1098,9 @@ public class GMSJoinLeave implements JoinLeave, MessageHandler {
     state.locatorsContacted = 0;
 
     do {
-      for (InetSocketAddress addr : locators) {
+      for (HostAddress laddr : locators) {
         try {
+          InetSocketAddress addr = laddr.getSocketInetAddress();
           Object o = tcpClientWrapper.sendCoordinatorFindRequest(addr, request, connectTimeout);
           FindCoordinatorResponse response =
               (o instanceof FindCoordinatorResponse) ? (FindCoordinatorResponse) o : null;
@@ -1135,6 +1136,7 @@ public class GMSJoinLeave implements JoinLeave, MessageHandler {
             }
           }
         } catch (IOException | ClassNotFoundException problem) {
+          logger.debug("EOFException IOException ", problem);
         }
       }
     } while (!anyResponses && System.currentTimeMillis() < giveUpTime);
@@ -1187,7 +1189,7 @@ public class GMSJoinLeave implements JoinLeave, MessageHandler {
         FindCoordinatorRequest request, int connectTimeout)
         throws ClassNotFoundException, IOException {
       TcpClient client = new TcpClient();
-      return client.requestToServer(addr.getAddress(), addr.getPort(), request, connectTimeout);
+      return client.requestToServer(addr, request, connectTimeout, true);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/ea8840fc/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/HostAddress.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/HostAddress.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/HostAddress.java
new file mode 100644
index 0000000..58ef3a5
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/HostAddress.java
@@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package org.apache.geode.distributed.internal.membership.gms.membership;
+
+import java.net.InetSocketAddress;
+
+import org.apache.commons.validator.routines.InetAddressValidator;
+
+public class HostAddress {
+  private InetSocketAddress socketInetAddress;
+  private String hostname;
+  private int port;
+  private boolean isIpString;
+
+  public HostAddress(InetSocketAddress loc, String locStr) {
+    this.socketInetAddress = loc;
+    this.hostname = locStr;
+    this.port = loc.getPort();
+    this.isIpString = InetAddressValidator.getInstance().isValid(locStr);
+  }
+
+  public boolean isIpString() {
+    return isIpString;
+  }
+
+  /**
+   * if host is ipString then it will return the cached InetScoketAddress Otherwise it will create
+   * the new instance of InetScoketAddress
+   * 
+   * @return
+   */
+  public InetSocketAddress getSocketInetAddress() {
+    if (this.isIpString) {
+      return this.socketInetAddress;
+    } else {
+      InetSocketAddress isa = new InetSocketAddress(hostname, this.socketInetAddress.getPort());
+      return isa;
+    }
+  }
+
+
+
+  public String getHostName() {
+    return hostname;
+  }
+
+
+  public int getPort() {
+    return port;
+  }
+
+  /**
+   * If component has retry logic then use this method to get the InetSocketAddress address
+   * AutoConnectionSourceImpl for client has retry logic; This way client will not make DNS query
+   * each time
+   * 
+   * @return InetSocketAddress
+   */
+  public InetSocketAddress getSocketInetAddressC() {
+    return this.socketInetAddress;
+  }
+
+  @Override
+  public int hashCode() {
+    final int prime = 31;
+    int result = 1;
+    result = prime * result + (isIpString ? 1231 : 1237);
+    result = prime * result + ((socketInetAddress == null) ? 0 : socketInetAddress.hashCode());
+    result = prime * result + ((hostname == null) ? 0 : hostname.hashCode());
+    return result;
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    if (this == obj)
+      return true;
+    if (obj == null)
+      return false;
+    if (getClass() != obj.getClass())
+      return false;
+    HostAddress other = (HostAddress) obj;
+    if (isIpString != other.isIpString)
+      return false;
+    if (socketInetAddress == null) {
+      if (other.socketInetAddress != null)
+        return false;
+    } else if (!socketInetAddress.equals(other.socketInetAddress))
+      return false;
+    if (hostname == null) {
+      if (other.hostname != null)
+        return false;
+    } else if (!hostname.equals(other.hostname))
+      return false;
+    return true;
+  }
+
+  @Override
+  public String toString() {
+    return "LocatorAddress [locatorSocketInetAddress=" + socketInetAddress + ", lochostname="
+        + hostname + ", isIpString=" + isIpString + "]";
+  }
+
+
+
+}

http://git-wip-us.apache.org/repos/asf/geode/blob/ea8840fc/geode-core/src/main/java/org/apache/geode/distributed/internal/tcpserver/TcpClient.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/tcpserver/TcpClient.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/tcpserver/TcpClient.java
index e9476b5..b2189f4 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/tcpserver/TcpClient.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/tcpserver/TcpClient.java
@@ -158,7 +158,7 @@ public class TcpClient {
     if (addr == null) {
       ipAddr = new InetSocketAddress(port);
     } else {
-      ipAddr = new InetSocketAddress(addr.getHostName(), port); // fix for bug 30810
+      ipAddr = new InetSocketAddress(addr, port); // fix for bug 30810 bruce??
     }
     return requestToServer(ipAddr, request, timeout, replyExpected);
   }
@@ -232,6 +232,7 @@ public class TcpClient {
           logger.debug("received response: {}", response);
           return response;
         } catch (EOFException ex) {
+          logger.debug("requestToServer EOFException ", ex);
           EOFException eof = new EOFException("Locator at " + ipAddr
               + " did not respond. This is normal if the locator was shutdown. If it wasn't check its log for exceptions.");
           eof.initCause(ex);

http://git-wip-us.apache.org/repos/asf/geode/blob/ea8840fc/geode-core/src/main/java/org/apache/geode/internal/admin/remote/DistributionLocatorId.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/DistributionLocatorId.java b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/DistributionLocatorId.java
index 5ab1bed..23801d9 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/DistributionLocatorId.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/DistributionLocatorId.java
@@ -23,12 +23,14 @@ import org.apache.geode.internal.admin.SSLConfig;
 import org.apache.geode.internal.i18n.LocalizedStrings;
 
 import java.net.InetAddress;
+import java.net.InetSocketAddress;
 import java.net.UnknownHostException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 
 import org.apache.commons.lang.StringUtils;
+import org.apache.commons.validator.routines.InetAddressValidator;
 
 /**
  * Identifies the host, port, and bindAddress a distribution locator is listening on.
@@ -38,7 +40,7 @@ import org.apache.commons.lang.StringUtils;
 public class DistributionLocatorId implements java.io.Serializable {
   private static final long serialVersionUID = 6587390186971937865L;
 
-  private final InetAddress host;
+  private InetAddress host;
   private final int port;
   private final String bindAddress;
   transient private SSLConfig sslConfig;
@@ -47,6 +49,7 @@ public class DistributionLocatorId implements java.io.Serializable {
   private boolean peerLocator = true;
   private boolean serverLocator = true;
   private String hostnameForClients;
+  private String hostname;
 
   /**
    * Constructs a DistributionLocatorId with the given host and port.
@@ -116,7 +119,7 @@ public class DistributionLocatorId implements java.io.Serializable {
       bindIdx = marshalled.lastIndexOf(':');
     }
 
-    String hostname = marshalled.substring(0, bindIdx > -1 ? bindIdx : portStartIdx);
+    hostname = marshalled.substring(0, bindIdx > -1 ? bindIdx : portStartIdx);
 
     if (hostname.indexOf(':') >= 0) {
       bindIdx = marshalled.lastIndexOf('@');
@@ -127,9 +130,7 @@ public class DistributionLocatorId implements java.io.Serializable {
     try {
       this.host = InetAddress.getByName(hostname);
     } catch (UnknownHostException ex) {
-      throw new InternalGemFireException(
-          LocalizedStrings.DistributionLocatorId_FAILED_GETTING_HOST_FROM_NAME_0
-              .toLocalizedString(hostname));
+      this.host = null;
     }
 
     try {
@@ -215,9 +216,37 @@ public class DistributionLocatorId implements java.io.Serializable {
     return this.port;
   }
 
-  /** Returns the host. */
-  public InetAddress getHost() {
-    return this.host;
+  /**
+   * Returns the resolved InetSocketAddress of the locator We cache the InetAddress if hostname is
+   * ipString Otherwise we create InetAddress each time.
+   * 
+   **/
+  public InetSocketAddress getHost() throws UnknownHostException {
+    if (hostname != null) {
+      boolean isIpString = InetAddressValidator.getInstance().isValid(hostname);
+      if (isIpString) {
+        if (this.host == null) {
+          this.host = InetAddress.getByName(hostname);
+        }
+        return new InetSocketAddress(this.host, port);
+      }
+    }
+
+    if (this.hostname == null) {
+      if (this.host != null) {
+        return new InetSocketAddress(this.host, port);
+      }
+      throw new UnknownHostException("locator ID has no hostname or resolved inet address");
+    }
+    return new InetSocketAddress(hostname, port);
+  }
+
+  /** returns the host name */
+  public String getHostName() {
+    if (this.hostname == null) {
+      this.hostname = this.host.getHostName();
+    }
+    return this.hostname;
   }
 
   /** Returns true if this is a multicast address:port */

http://git-wip-us.apache.org/repos/asf/geode/blob/ea8840fc/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RemoteTransportConfig.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RemoteTransportConfig.java b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RemoteTransportConfig.java
index 1dc2fd1..4759fe8 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RemoteTransportConfig.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RemoteTransportConfig.java
@@ -30,6 +30,7 @@ import org.apache.geode.internal.admin.SSLConfig;
 import org.apache.geode.internal.admin.TransportConfig;
 import org.apache.geode.internal.i18n.LocalizedStrings;
 
+import java.net.UnknownHostException;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
@@ -259,7 +260,7 @@ public class RemoteTransportConfig implements TransportConfig {
     }
     if (this.mcastEnabled) {
       // Fix bug 32849
-      props.setProperty(MCAST_ADDRESS, String.valueOf(this.mcastId.getHost().getHostAddress()));
+      props.setProperty(MCAST_ADDRESS, this.mcastId.getHostName());
       props.setProperty(MCAST_PORT, String.valueOf(this.mcastId.getPort()));
 
     } else {
@@ -274,7 +275,7 @@ public class RemoteTransportConfig implements TransportConfig {
         if (baddr != null && baddr.trim().length() > 0) {
           locators.append(baddr);
         } else {
-          locators.append(locator.getHost().getCanonicalHostName());
+          locators.append(locator.getHostName());
         }
         locators.append("[");
         locators.append(locator.getPort());

http://git-wip-us.apache.org/repos/asf/geode/blob/ea8840fc/geode-core/src/main/java/org/apache/geode/internal/cache/ClusterConfigurationLoader.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/ClusterConfigurationLoader.java b/geode-core/src/main/java/org/apache/geode/internal/cache/ClusterConfigurationLoader.java
index 92cfd96..1c4104e 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/ClusterConfigurationLoader.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/ClusterConfigurationLoader.java
@@ -231,7 +231,7 @@ public class ClusterConfigurationLoader {
       if (StringUtils.isNotBlank(ipaddress)) {
         locatorInetAddress = InetAddress.getByName(ipaddress);
       } else {
-        locatorInetAddress = dlId.getHost();
+        locatorInetAddress = dlId.getHost().getAddress();
       }
 
       int port = dlId.getPort();

http://git-wip-us.apache.org/repos/asf/geode/blob/ea8840fc/geode-core/src/main/java/org/apache/geode/internal/cache/PoolFactoryImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/PoolFactoryImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/PoolFactoryImpl.java
index d4fdbd0..65d6e02 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/PoolFactoryImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/PoolFactoryImpl.java
@@ -37,6 +37,7 @@ import org.apache.geode.cache.client.internal.LocatorDiscoveryCallback;
 import org.apache.geode.cache.client.internal.PoolImpl;
 import org.apache.geode.cache.query.QueryService;
 import org.apache.geode.cache.wan.GatewaySender;
+import org.apache.geode.distributed.internal.membership.gms.membership.HostAddress;
 import org.apache.geode.internal.i18n.LocalizedStrings;
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.internal.logging.log4j.LocalizedMessage;
@@ -55,6 +56,8 @@ public class PoolFactoryImpl implements PoolFactory {
    */
   private PoolAttributes attributes = new PoolAttributes();
 
+  private List<HostAddress> loators = new ArrayList<>();
+
   /**
    * The cache that created this factory
    */
@@ -217,25 +220,24 @@ public class PoolFactoryImpl implements PoolFactory {
     return this;
   }
 
-  private PoolFactory add(String host, int port, List l) {
+  private InetSocketAddress getInetSocketAddress(String host, int port) {
     if (port == 0) {
       throw new IllegalArgumentException("port must be greater than 0 but was " + port);
       // the rest of the port validation is done by InetSocketAddress
     }
+    InetSocketAddress sockAddr = null;
     try {
       InetAddress hostAddr = InetAddress.getByName(host);
-      InetSocketAddress sockAddr = new InetSocketAddress(hostAddr, port);
-      l.add(sockAddr);
+      sockAddr = new InetSocketAddress(hostAddr, port);
     } catch (UnknownHostException ignore) {
       // IllegalArgumentException ex = new IllegalArgumentException("Unknown host " + host);
       // ex.initCause(cause);
       // throw ex;
       // Fix for #45348
       logger.warn(LocalizedMessage.create(LocalizedStrings.PoolFactoryImpl_HOSTNAME_UNKNOWN, host));
-      InetSocketAddress sockAddr = new InetSocketAddress(host, port);
-      l.add(sockAddr);
+      sockAddr = new InetSocketAddress(host, port);
     }
-    return this;
+    return sockAddr;
   }
 
   public PoolFactory setSubscriptionAckInterval(int ackInterval) {
@@ -252,7 +254,10 @@ public class PoolFactoryImpl implements PoolFactory {
       throw new IllegalStateException(
           "A server has already been added. You can only add locators or servers; not both.");
     }
-    return add(host, port, this.attributes.locators);
+    InetSocketAddress isa = getInetSocketAddress(host, port);
+    this.attributes.locators.add(isa);
+    loators.add(new HostAddress(isa, host));
+    return this;
   }
 
   public PoolFactory addServer(String host, int port) {
@@ -260,7 +265,9 @@ public class PoolFactoryImpl implements PoolFactory {
       throw new IllegalStateException(
           "A locator has already been added. You can only add locators or servers; not both.");
     }
-    return add(host, port, this.attributes.servers);
+    InetSocketAddress isa = getInetSocketAddress(host, port);
+    this.attributes.servers.add(isa);
+    return this;
   }
 
   public PoolFactory reset() {
@@ -295,7 +302,10 @@ public class PoolFactoryImpl implements PoolFactory {
     setSubscriptionAckInterval(cp.getSubscriptionAckInterval());
     setServerGroup(cp.getServerGroup());
     setMultiuserAuthentication(cp.getMultiuserAuthentication());
-    this.attributes.locators.addAll(cp.getLocators());
+    for (InetSocketAddress l : cp.getLocators()) {
+      addLocator(l.getHostName(), l.getPort());
+    }
+    // this.attributes.locators.addAll(cp.getLocators());
     this.attributes.servers.addAll(cp.getServers());
   }
 
@@ -327,7 +337,7 @@ public class PoolFactoryImpl implements PoolFactory {
         registry.creatingPool();
       }
     }
-    return PoolImpl.create(this.pm, name, this.attributes);
+    return PoolImpl.create(this.pm, name, this.attributes, this.loators);
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/geode/blob/ea8840fc/geode-core/src/test/java/org/apache/geode/cache/client/internal/AutoConnectionSourceDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache/client/internal/AutoConnectionSourceDUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache/client/internal/AutoConnectionSourceDUnitTest.java
index 789d326..deb3325 100644
--- a/geode-core/src/test/java/org/apache/geode/cache/client/internal/AutoConnectionSourceDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache/client/internal/AutoConnectionSourceDUnitTest.java
@@ -160,10 +160,12 @@ public class AutoConnectionSourceDUnitTest extends LocatorTestBase {
       final int locatorPort3 = ports[2];
       String locators =
           getLocatorString(host, new int[] {locatorPort0, locatorPort1, locatorPort3});
-      vm0.invoke("Start Locator", () -> startLocator(NetworkUtils.getServerHostName(vm0.getHost()),
-          locatorPort0, locators));
-      vm1.invoke("Start Locator", () -> startLocator(NetworkUtils.getServerHostName(vm1.getHost()),
-          locatorPort1, locators));
+      vm0.invoke("Start Locator1 ",
+          () -> startLocator(NetworkUtils.getServerHostName(vm0.getHost()), locatorPort0,
+              locators));
+      vm1.invoke("Start Locator2 ",
+          () -> startLocator(NetworkUtils.getServerHostName(vm1.getHost()), locatorPort1,
+              locators));
 
       vm2.invoke("StartBridgeClient", () -> startBridgeClient(null,
           NetworkUtils.getServerHostName(vm0.getHost()), locatorPort0));
@@ -524,7 +526,7 @@ public class AutoConnectionSourceDUnitTest extends LocatorTestBase {
         }
 
         List<InetSocketAddress> locators = pool.getOnlineLocators();
-        Assert.assertEquals(expected.length, locators.size());
+        Assert.assertEquals("found " + locators, expected.length, locators.size());
         Arrays.sort(expected, Comparator.comparing(InetSocketAddress::getPort));
         for (int i = 0; i < locators.size(); i++) {
           InetSocketAddress locator = locators.get(i);

http://git-wip-us.apache.org/repos/asf/geode/blob/ea8840fc/geode-core/src/test/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImplJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImplJUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImplJUnitTest.java
index 9169904..b5dc288 100644
--- a/geode-core/src/test/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImplJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImplJUnitTest.java
@@ -18,14 +18,18 @@ import org.apache.geode.CancelCriterion;
 import org.apache.geode.cache.*;
 import org.apache.geode.cache.client.NoAvailableLocatorsException;
 import org.apache.geode.cache.client.SubscriptionNotEnabledException;
+import org.apache.geode.cache.client.internal.AutoConnectionSourceImpl.UpdateLocatorListTask;
+import org.apache.geode.cache.client.internal.PoolImpl.PoolTask;
 import org.apache.geode.cache.client.internal.locator.ClientConnectionRequest;
 import org.apache.geode.cache.client.internal.locator.ClientConnectionResponse;
+import org.apache.geode.cache.client.internal.locator.LocatorListRequest;
 import org.apache.geode.cache.client.internal.locator.LocatorListResponse;
 import org.apache.geode.cache.query.QueryService;
 import org.apache.geode.distributed.DistributedSystem;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.distributed.internal.PoolStatHelper;
 import org.apache.geode.distributed.internal.ServerLocation;
+import org.apache.geode.distributed.internal.membership.gms.membership.HostAddress;
 import org.apache.geode.distributed.internal.ClusterConfigurationService;
 import org.apache.geode.distributed.internal.DistributionConfig;
 import org.apache.geode.distributed.internal.tcpserver.TcpClient;
@@ -59,6 +63,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
+import java.util.concurrent.Callable;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
@@ -70,6 +75,7 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.fail;
 
 import org.awaitility.Awaitility;
+import org.awaitility.Duration;
 
 /**
  *
@@ -113,8 +119,12 @@ public class AutoConnectionSourceImplJUnitTest {
     background = Executors.newSingleThreadScheduledExecutor();
 
     List/* <InetSocketAddress> */ locators = new ArrayList();
-    locators.add(new InetSocketAddress(InetAddress.getLocalHost(), port));
-    source = new AutoConnectionSourceImpl(locators, "", 60 * 1000);
+    InetAddress ia = InetAddress.getLocalHost();
+    InetSocketAddress isa = new InetSocketAddress(ia, port);
+    locators.add(isa);
+    List<HostAddress> la = new ArrayList<>();
+    la.add(new HostAddress(isa, ia.getHostName()));
+    source = new AutoConnectionSourceImpl(locators, la, "", 60 * 1000);
     source.start(pool);
   }
 
@@ -159,12 +169,18 @@ public class AutoConnectionSourceImplJUnitTest {
     List<InetSocketAddress> locators = new ArrayList();
     InetSocketAddress floc1 = new InetSocketAddress("fakeLocalHost1", port);
     InetSocketAddress floc2 = new InetSocketAddress("fakeLocalHost2", port);
+
     locators.add(floc1);
     locators.add(floc2);
-    AutoConnectionSourceImpl src = new AutoConnectionSourceImpl(locators, "", 60 * 1000);
+
+    List<HostAddress> la = new ArrayList<>();
+    la.add(new HostAddress(floc1, floc1.getHostName()));
+    la.add(new HostAddress(floc2, floc2.getHostName()));
+
+    AutoConnectionSourceImpl src = new AutoConnectionSourceImpl(locators, la, "", 60 * 1000);
 
     // This method will create a new InetSocketAddress of floc1
-    src.updateLocatorInLocatorList(floc1);
+    src.updateLocatorInLocatorList(new HostAddress(floc1, floc1.getHostName()));
 
     List<InetSocketAddress> cLocList = src.getCurrentLocators();
 
@@ -191,18 +207,24 @@ public class AutoConnectionSourceImplJUnitTest {
     InetSocketAddress floc2 = new InetSocketAddress("fakeLocalHost2", port);
     locators.add(floc1);
     locators.add(floc2);
-    AutoConnectionSourceImpl src = new AutoConnectionSourceImpl(locators, "", 60 * 1000);
+    List<HostAddress> la = new ArrayList<>();
+    la.add(new HostAddress(floc1, floc1.getHostName()));
+    la.add(new HostAddress(floc2, floc2.getHostName()));
+    AutoConnectionSourceImpl src = new AutoConnectionSourceImpl(locators, la, "", 60 * 1000);
 
 
-    Set<InetSocketAddress> badLocators = new HashSet<>();
     InetSocketAddress b1 = new InetSocketAddress("fakeLocalHost1", port);
     InetSocketAddress b2 = new InetSocketAddress("fakeLocalHost3", port);
-    badLocators.add(b1);
-    badLocators.add(b2);
 
-    src.addbadLocators(locators, badLocators);
+    Set<HostAddress> bla = new HashSet<>();
+    bla.add(new HostAddress(b1, b1.getHostName()));
+    bla.add(new HostAddress(b2, b2.getHostName()));
+
 
-    Assert.assertEquals(3, locators.size());
+    src.addbadLocators(la, bla);
+
+    System.out.println("new locatores " + la );
+    Assert.assertEquals(3, la.size());
   }
 
   @Test
@@ -276,6 +298,11 @@ public class AutoConnectionSourceImplJUnitTest {
     assertEquals(loc1, source.findServer(null));
   }
 
+  /**
+   * This tests that discovery works even after one of two locators was shut down
+   * 
+   * @throws Exception
+   */
   @Test
   public void testDiscoverLocators() throws Exception {
     startFakeLocator();
@@ -310,6 +337,41 @@ public class AutoConnectionSourceImplJUnitTest {
   }
 
   @Test
+  public void testDiscoverLocatorsConnectsToLocatorsAfterTheyStartUp() throws Exception {
+    ArrayList locators = new ArrayList();
+    locators.add(new ServerLocation(InetAddress.getLocalHost().getHostName(), port));
+    handler.nextLocatorListResponse = new LocatorListResponse(locators, false);
+    
+    try {
+      Awaitility.await().pollDelay(new Duration(200, TimeUnit.MILLISECONDS)).atMost(500, TimeUnit.MILLISECONDS).until(new Callable<Boolean>() {
+
+        @Override
+        public Boolean call() throws Exception {
+          return source.getOnlineLocators().isEmpty();
+        }
+      });
+      startFakeLocator();
+
+      server.join(1000);
+      
+      Awaitility.await().atMost(5000, TimeUnit.MILLISECONDS).until(new Callable<Boolean>() {
+
+        @Override
+        public Boolean call() throws Exception {
+          return source.getOnlineLocators().size() == 1;
+        }
+      });
+    } finally {
+      try {
+        new TcpClient().stop(InetAddress.getLocalHost(), port);
+      } catch (ConnectException ignore) {
+        // must not be running
+      }
+      server.join(60 * 1000);
+    }
+  }
+
+  @Test
   public void testSysPropLocatorUpdateInterval() throws Exception {
     long updateLocatorInterval = 543;
     System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "LOCATOR_UPDATE_INTERVAL",
@@ -598,5 +660,5 @@ public class AutoConnectionSourceImplJUnitTest {
     }
 
     public void setServerAffinityLocation(ServerLocation serverLocation) {}
-  }
+  }  
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/ea8840fc/geode-core/src/test/java/org/apache/geode/distributed/internal/DistributionConfigJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/DistributionConfigJUnitTest.java b/geode-core/src/test/java/org/apache/geode/distributed/internal/DistributionConfigJUnitTest.java
index 9f6c5fb..9bd8dd8 100644
--- a/geode-core/src/test/java/org/apache/geode/distributed/internal/DistributionConfigJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/DistributionConfigJUnitTest.java
@@ -342,7 +342,7 @@ public class DistributionConfigJUnitTest {
     assertEquals(config.getStartLocator(), address);
   }
 
-  @Test(expected = InternalGemFireException.class)
+  @Test
   public void testInvalidLocatorAddress() {
     String address = "bad.bad[7056]";
     config.modifiable = true;

http://git-wip-us.apache.org/repos/asf/geode/blob/ea8840fc/geode-core/src/test/java/org/apache/geode/distributed/internal/StartupMessageDataJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/StartupMessageDataJUnitTest.java b/geode-core/src/test/java/org/apache/geode/distributed/internal/StartupMessageDataJUnitTest.java
index 9d63050..b5a62ca 100755
--- a/geode-core/src/test/java/org/apache/geode/distributed/internal/StartupMessageDataJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/StartupMessageDataJUnitTest.java
@@ -252,9 +252,9 @@ public class StartupMessageDataJUnitTest {
 
   private String createOneLocatorString() throws Exception {
     DistributionLocatorId locatorId =
-        new DistributionLocatorId(SocketCreator.getLocalHost(), 445566, "111.222.333.444", null);
+        new DistributionLocatorId(SocketCreator.getLocalHost(), 44556, "111.222.333.444", null);
     String locatorString = locatorId.marshal();
-    assertEquals("" + locatorId.getHost().getHostAddress() + ":111.222.333.444[445566]",
+    assertEquals("" + locatorId.getHost().getAddress().getHostAddress() + ":111.222.333.444[44556]",
         locatorString);
     return locatorString;
   }

http://git-wip-us.apache.org/repos/asf/geode/blob/ea8840fc/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java
index a31fa8d..ff61a50 100644
--- a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java
@@ -36,6 +36,7 @@ import org.apache.geode.distributed.internal.DistributionConfig;
 import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
 import org.apache.geode.distributed.internal.membership.NetView;
 import org.apache.geode.distributed.internal.membership.gms.GMSMember;
+import org.apache.geode.distributed.internal.membership.gms.GMSUtil;
 import org.apache.geode.distributed.internal.membership.gms.ServiceConfig;
 import org.apache.geode.distributed.internal.membership.gms.Services;
 import org.apache.geode.distributed.internal.membership.gms.Services.Stopper;

http://git-wip-us.apache.org/repos/asf/geode/blob/ea8840fc/geode-core/src/test/resources/org/apache/geode/codeAnalysis/excludedClasses.txt
----------------------------------------------------------------------
diff --git a/geode-core/src/test/resources/org/apache/geode/codeAnalysis/excludedClasses.txt b/geode-core/src/test/resources/org/apache/geode/codeAnalysis/excludedClasses.txt
index 6a6e0c1..db234e0 100644
--- a/geode-core/src/test/resources/org/apache/geode/codeAnalysis/excludedClasses.txt
+++ b/geode-core/src/test/resources/org/apache/geode/codeAnalysis/excludedClasses.txt
@@ -155,4 +155,5 @@ org/apache/geode/distributed/internal/tcpserver/LocatorCancelException
 org.apache.geode.internal.security.SecurableCommunicationChannel
 org/apache/geode/internal/security/shiro/GeodeAuthenticationToken
 org/apache/geode/internal/cache/InitialImageOperation$GIITestHook
-org/apache/geode/internal/AvailablePort$Keeper
\ No newline at end of file
+org/apache/geode/internal/AvailablePort$Keeper
+org/apache/geode/internal/admin/remote/DistributionLocatorId

http://git-wip-us.apache.org/repos/asf/geode/blob/ea8840fc/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/LocatorDiscovery.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/LocatorDiscovery.java b/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/LocatorDiscovery.java
index f5a8fcf..dd3fc84 100644
--- a/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/LocatorDiscovery.java
+++ b/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/LocatorDiscovery.java
@@ -131,8 +131,8 @@ public class LocatorDiscovery {
     while (!getDiscoverer().isStopped()) {
       try {
         RemoteLocatorJoinResponse response =
-            (RemoteLocatorJoinResponse) locatorClient.requestToServer(locatorId.getHost(),
-                locatorId.getPort(), request, WanLocatorDiscoverer.WAN_LOCATOR_CONNECTION_TIMEOUT);
+            (RemoteLocatorJoinResponse) locatorClient.requestToServer(locatorId.getHost(), request,
+                WanLocatorDiscoverer.WAN_LOCATOR_CONNECTION_TIMEOUT, true);
         if (response != null) {
           LocatorHelper.addExchangedLocators(response.getLocators(), this.locatorListener);
           logger.info(LocalizedMessage.create(
@@ -181,8 +181,7 @@ public class LocatorDiscovery {
       try {
         response =
             (RemoteLocatorJoinResponse) locatorClient.requestToServer(remoteLocator.getHost(),
-                remoteLocator.getPort(), request,
-                WanLocatorDiscoverer.WAN_LOCATOR_CONNECTION_TIMEOUT);
+                request, WanLocatorDiscoverer.WAN_LOCATOR_CONNECTION_TIMEOUT, true);
         if (response != null) {
           LocatorHelper.addExchangedLocators(response.getLocators(), this.locatorListener);
           logger.info(LocalizedMessage.create(
@@ -193,8 +192,7 @@ public class LocatorDiscovery {
             Thread.sleep(WAN_LOCATOR_PING_INTERVAL);
             RemoteLocatorPingResponse pingResponse =
                 (RemoteLocatorPingResponse) locatorClient.requestToServer(remoteLocator.getHost(),
-                    remoteLocator.getPort(), pingRequest,
-                    WanLocatorDiscoverer.WAN_LOCATOR_CONNECTION_TIMEOUT);
+                    pingRequest, WanLocatorDiscoverer.WAN_LOCATOR_CONNECTION_TIMEOUT, true);
             if (pingResponse != null) {
               continue;
             }

http://git-wip-us.apache.org/repos/asf/geode/blob/ea8840fc/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/LocatorMembershipListenerImpl.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/LocatorMembershipListenerImpl.java b/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/LocatorMembershipListenerImpl.java
index d6d5d7c..5fe1eda 100644
--- a/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/LocatorMembershipListenerImpl.java
+++ b/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/LocatorMembershipListenerImpl.java
@@ -104,25 +104,25 @@ public class LocatorMembershipListenerImpl implements LocatorMembershipListener
           }
           for (DistributionLocatorId value : entry.getValue()) {
             try {
-              tcpClient.requestToServer(value.getHost(), value.getPort(),
+              tcpClient.requestToServer(value.getHost(),
                   new LocatorJoinMessage(distributedSystemId, locator, localLocatorId, ""), 1000,
                   false);
             } catch (Exception e) {
               if (logger.isDebugEnabled()) {
                 logger.debug(LocalizedMessage.create(
                     LocalizedStrings.LOCATOR_MEMBERSHIP_LISTENER_COULD_NOT_EXCHANGE_LOCATOR_INFORMATION_0_1_WIHT_2_3,
-                    new Object[] {locator.getHost(), locator.getPort(), value.getHost(),
+                    new Object[] {locator.getHostName(), locator.getPort(), value.getHostName(),
                         value.getPort()}));
               }
             }
             try {
-              tcpClient.requestToServer(locator.getHost(), locator.getPort(),
+              tcpClient.requestToServer(locator.getHost(),
                   new LocatorJoinMessage(entry.getKey(), value, localLocatorId, ""), 1000, false);
             } catch (Exception e) {
               if (logger.isDebugEnabled()) {
                 logger.debug(LocalizedMessage.create(
                     LocalizedStrings.LOCATOR_MEMBERSHIP_LISTENER_COULD_NOT_EXCHANGE_LOCATOR_INFORMATION_0_1_WIHT_2_3,
-                    new Object[] {value.getHost(), value.getPort(), locator.getHost(),
+                    new Object[] {value.getHostName(), value.getPort(), locator.getHostName(),
                         locator.getPort()}));
               }
             }

http://git-wip-us.apache.org/repos/asf/geode/blob/ea8840fc/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/AbstractRemoteGatewaySender.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/AbstractRemoteGatewaySender.java b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/AbstractRemoteGatewaySender.java
index dbc2cc6..00cc760 100644
--- a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/AbstractRemoteGatewaySender.java
+++ b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/AbstractRemoteGatewaySender.java
@@ -75,8 +75,8 @@ public abstract class AbstractRemoteGatewaySender extends AbstractGatewaySender
       DistributionLocatorId locatorID = new DistributionLocatorId(localLocator);
       try {
         RemoteLocatorResponse response =
-            (RemoteLocatorResponse) new TcpClient().requestToServer(locatorID.getHost(),
-                locatorID.getPort(), request, WanLocatorDiscoverer.WAN_LOCATOR_CONNECTION_TIMEOUT);
+            (RemoteLocatorResponse) new TcpClient().requestToServer(locatorID.getHost(), request,
+                WanLocatorDiscoverer.WAN_LOCATOR_CONNECTION_TIMEOUT, true);
 
         if (response != null) {
           if (response.getLocators() == null) {

http://git-wip-us.apache.org/repos/asf/geode/blob/ea8840fc/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/misc/WanAutoDiscoveryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/misc/WanAutoDiscoveryDUnitTest.java b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/misc/WanAutoDiscoveryDUnitTest.java
index 6d75064..63f6005 100644
--- a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/misc/WanAutoDiscoveryDUnitTest.java
+++ b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/misc/WanAutoDiscoveryDUnitTest.java
@@ -603,6 +603,7 @@ public class WanAutoDiscoveryDUnitTest extends WANTestBase {
     testRemoteLocators(remoteLocators, true, 1);
   }
 
+  // pool has been created even though locator address is not valid
   @Test
   public void testInvalidHostRemoteLocators() {
     IgnoredException ie = IgnoredException
@@ -610,7 +611,8 @@ public class WanAutoDiscoveryDUnitTest extends WANTestBase {
     try {
       Set<String> remoteLocators = new HashSet();
       addUnknownHost(remoteLocators);
-      testRemoteLocators(remoteLocators, false, 0);
+      // now we don't validata address upfront
+      testRemoteLocators(remoteLocators, true, 1);
     } finally {
       ie.remove();
     }
@@ -621,7 +623,8 @@ public class WanAutoDiscoveryDUnitTest extends WANTestBase {
     Set<String> remoteLocators = new HashSet();
     remoteLocators.add("localhost[12345]");
     addUnknownHost(remoteLocators);
-    testRemoteLocators(remoteLocators, true, 1);
+    // now we add the locator to pool, because we don't validate locator address
+    testRemoteLocators(remoteLocators, true, 2);
   }
 
   private void addUnknownHost(Set<String> remoteLocators) {

http://git-wip-us.apache.org/repos/asf/geode/blob/ea8840fc/gradle/dependency-versions.properties
----------------------------------------------------------------------
diff --git a/gradle/dependency-versions.properties b/gradle/dependency-versions.properties
index 6a730a4..4dd3f34 100644
--- a/gradle/dependency-versions.properties
+++ b/gradle/dependency-versions.properties
@@ -98,3 +98,4 @@ tempus-fugit.version = 1.1
 tomcat6.version = 6.0.37
 tomcat7.version = 7.0.73
 tomcat8.version = 8.5.9
+commons-validator.version = 1.6


Mime
View raw message