geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jensde...@apache.org
Subject [35/51] [abbrv] geode git commit: GEODE-2804 Caching the InetAddress for configured ip string
Date Mon, 10 Jul 2017 18:00:58 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/92f27080
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/92f27080
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/92f27080

Branch: refs/heads/feature/GEODE-3109
Commit: 92f270805a83c69da2c1ab469b3206ae6e7c9acf
Parents: f116199
Author: Hitesh Khamesra <hkhamesra@pivotal.io>
Authored: Thu Jun 29 13:20:17 2017 -0700
Committer: Hitesh Khamesra <hkhamesra@pivotal.io>
Committed: Mon Jul 3 09:29:37 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      | 171 +++++++++++++------
 .../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      |  13 +-
 .../membership/gms/membership/GMSJoinLeave.java |   9 +-
 .../membership/gms/membership/HostAddress.java  | 118 +++++++++++++
 .../internal/tcpserver/TcpClient.java           |  26 ++-
 .../admin/remote/DistributionLocatorId.java     |  45 ++++-
 .../admin/remote/RemoteTransportConfig.java     |   5 +-
 .../cache/ClusterConfigurationLoader.java       |   2 +-
 .../geode/internal/cache/PoolFactoryImpl.java   |  28 +--
 .../internal/JmxManagerLocatorRequest.java      |   5 +-
 .../cli/commands/LauncherLifecycleCommands.java |   1 +
 .../internal/AutoConnectionSourceDUnitTest.java |  12 +-
 .../AutoConnectionSourceImplJUnitTest.java      | 126 +++++++++++++-
 .../internal/DistributionConfigJUnitTest.java   |   4 +-
 .../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 +
 30 files changed, 527 insertions(+), 129 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/92f27080/geode-assembly/build.gradle
----------------------------------------------------------------------
diff --git a/geode-assembly/build.gradle b/geode-assembly/build.gradle
index e5e96d8..19a73f3 100755
--- a/geode-assembly/build.gradle
+++ b/geode-assembly/build.gradle
@@ -156,6 +156,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/92f27080/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 ef28d5e..05f5834 100644
--- a/geode-assembly/src/test/resources/expected_jars.txt
+++ b/geode-assembly/src/test/resources/expected_jars.txt
@@ -86,4 +86,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/92f27080/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/92f27080/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/92f27080/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 53d401a..481f6ed 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,25 +70,27 @@ 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 address, HostAddress otherAddress) {
+          InetSocketAddress inetSocketAddress = address.getSocketInetAddress();
+          InetSocketAddress otherInetSocketAddress = otherAddress.getSocketInetAddress();
           // shouldn't happen, but if it does we'll say they're the same.
-          if (o1.getAddress() == null || o2.getAddress() == null) {
+          if (inetSocketAddress.getAddress() == null
+              || otherInetSocketAddress.getAddress() == null) {
             return 0;
           }
 
-          int result = o1.getAddress().getCanonicalHostName()
-              .compareTo(o2.getAddress().getCanonicalHostName());
+          int result = inetSocketAddress.getAddress().getCanonicalHostName()
+              .compareTo(otherInetSocketAddress.getAddress().getCanonicalHostName());
           if (result != 0) {
             return result;
+          } else {
+            return inetSocketAddress.getPort() - otherInetSocketAddress.getPort();
           }
-
-      else
-            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>();
@@ -103,17 +106,13 @@ public class AutoConnectionSourceImpl implements ConnectionSource {
   private final Map<InetSocketAddress, Exception> locatorState =
       new HashMap<InetSocketAddress, Exception>();
 
-  /**
-   * @param contacts
-   * @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) {
+    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,22 +201,22 @@ public class AutoConnectionSourceImpl implements ConnectionSource {
   }
 
 
-  private ServerLocationResponse queryOneLocator(InetSocketAddress locator,
+  private ServerLocationResponse queryOneLocator(HostAddress locator,
       ServerLocationRequest request) {
-    InetAddress addr = locator.getAddress();
-    int port = locator.getPort();
     Object returnObj = null;
     try {
       pool.getStats().incLocatorRequests();
-      returnObj = tcpClient.requestToServer(addr, port, request, connectionTimeout);
+      returnObj = tcpClient.requestToServer(locator.getSocketInetAddressNoLookup(), request,
+          connectionTimeout, true);
       ServerLocationResponse response = (ServerLocationResponse) returnObj;
       pool.getStats().incLocatorResponses();
       if (response != null) {
-        reportLiveLocator(locator);
+        reportLiveLocator(locator.getSocketInetAddressNoLookup());
       }
       return response;
     } catch (IOException ioe) {
-      reportDeadLocator(locator, ioe);
+      reportDeadLocator(locator.getSocketInetAddressNoLookup(), ioe);
+      updateLocatorInLocatorList(locator);
       return null;
     } catch (ClassNotFoundException e) {
       logger.warn(
@@ -229,24 +228,64 @@ public class AutoConnectionSourceImpl implements ConnectionSource {
       if (logger.isDebugEnabled()) {
         logger.debug("Received odd response object from the locator: {}", returnObj);
       }
-      reportDeadLocator(locator, e);
+      reportDeadLocator(locator.getSocketInetAddressNoLookup(), e);
       return null;
     }
   }
 
+  /**
+   * If connecting to the locator fails with an IOException, this may be because the locator's IP
+   * has changed. Add the locator back to the list of locators using host address rather than IP.
+   * This will cause another DNS lookup, hopefully finding the locator.
+   * 
+   * @param locator
+   */
+  protected void updateLocatorInLocatorList(HostAddress locator) {
+    if (locator.getSocketInetAddressNoLookup().getHostName() != null && !locator.isIpString()) {
+      LocatorList locatorList = locators.get();
+      List<HostAddress> newLocatorsList = new ArrayList<>();
+
+      for (HostAddress tloc : locatorList.getLocatorAddresses()) {
+        if (tloc.equals(locator)) {
+          /**
+           * This call doesn't throw UnknownHostException;
+           */
+          InetSocketAddress changeLoc = new InetSocketAddress(locator.getHostName(),
+              locator.getSocketInetAddressNoLookup().getPort());
+          HostAddress hostAddress = new HostAddress(changeLoc, locator.getHostName());
+          newLocatorsList.add(hostAddress);
+          logger.info("updateLocatorInLocatorList changing locator list: loc form: " + locator
+              + " ,loc to: " + changeLoc);
+        } else {
+          newLocatorsList.add(tloc);
+        }
+      }
+
+      logger.info("updateLocatorInLocatorList locator list from:" + locatorList.getLocators()
+          + " to: " + newLocatorsList);
+
+      LocatorList newLocatorList = new LocatorList(newLocatorsList);
+      locators.set(newLocatorList);
+    }
+  }
+
+  protected List<InetSocketAddress> getCurrentLocators() {
+    return locators.get().getLocators();
+  }
+
   protected ServerLocationResponse queryLocators(ServerLocationRequest request) {
     Iterator controllerItr = locators.get().iterator();
     ServerLocationResponse response = null;
 
     final boolean isDebugEnabled = logger.isDebugEnabled();
     do {
-      InetSocketAddress locator = (InetSocketAddress) controllerItr.next();
+      HostAddress hostAddress = (HostAddress) controllerItr.next();
       if (isDebugEnabled) {
-        logger.debug("Sending query to locator {}: {}", locator, request);
+        logger.debug("Sending query to locator {}: {}", hostAddress, request);
       }
-      response = queryOneLocator(locator, request);
+      response = queryOneLocator(hostAddress, request);
       if (isDebugEnabled) {
-        logger.debug("Received query response from locator {}: {}", locator, response);
+        logger.debug("Received query response from locator {}: {}", hostAddress, response);
       }
     } while (controllerItr.hasNext() && (response == null || !response.hasResult()));
 
@@ -263,28 +302,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 hostAddress = new HostAddress(address, locator.getHostName());
+      newLocatorAddresses.add(hostAddress);
+      newOnlineLocators.add(hostAddress);
+      badLocators.remove(hostAddress);
     }
 
-    newLocators.addAll(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));
@@ -299,10 +341,35 @@ 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<HostAddress> newLocators, Set<HostAddress> badLocators) {
+    for (HostAddress badloc : badLocators) {
+      boolean addIt = true;
+      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);
+      }
+    }
   }
 
   public void start(InternalPool pool) {
@@ -359,15 +426,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;
     }
 
@@ -375,7 +450,7 @@ public class AutoConnectionSourceImpl implements ConnectionSource {
       return locators.size();
     }
 
-    public Iterator<InetSocketAddress> iterator() {
+    public Iterator<HostAddress> iterator() {
       return new LocatorIterator();
     }
 
@@ -390,7 +465,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;
 
@@ -398,12 +473,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/92f27080/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/92f27080/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/92f27080/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/92f27080/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/92f27080/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..2c56f5b 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);
     }
@@ -381,14 +382,14 @@ public class GMSLocator implements Locator, NetLocator {
   }
 
   private void recover() throws InternalGemFireException {
-    if (!recoverFromOthers()) {
+    if (!recoverFromOtherLocators()) {
       recoverFromFile(viewFile);
     }
   }
 
-  private boolean recoverFromOthers() {
-    for (InetSocketAddress other : this.locators) {
-      if (recover(other)) {
+  private boolean recoverFromOtherLocators() {
+    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/92f27080/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 bc3d708..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,8 +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,
-          true);
+      return client.requestToServer(addr, request, connectTimeout, true);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/92f27080/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..1acb7c0
--- /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 InetSocketAddress Otherwise it will create
+   * the new instance of InetSocketAddress
+   * 
+   * @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 getSocketInetAddressNoLookup() {
+    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/92f27080/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 6b54170..d406891 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
@@ -134,6 +134,7 @@ public class TcpClient {
    */
   public Object requestToServer(InetAddress addr, int port, Object request, int timeout)
       throws IOException, ClassNotFoundException {
+
     return requestToServer(addr, port, request, timeout, true);
   }
 
@@ -146,7 +147,7 @@ public class TcpClient {
    * @param timeout Timeout for sending the message and receiving a reply
    * @param replyExpected Whether to wait for a reply
    *
-   * @return The reply, or null if no reply is expected
+   * @return the reply
    *
    * @throws IOException
    * @throws ClassNotFoundException
@@ -159,6 +160,28 @@ public class TcpClient {
     } else {
       ipAddr = new InetSocketAddress(addr, port); // fix for bug 30810
     }
+    return requestToServer(ipAddr, request, timeout, replyExpected);
+  }
+
+  /**
+   * Send a request to a Locator
+   * 
+   * @param ipAddr The locator's inet socket address
+   * @param request The request message
+   * @param timeout Timeout for sending the message and receiving a reply
+   * @param replyExpected Whether to wait for a reply
+   *
+   * @return The reply, or null if no reply is expected
+   *
+   * @throws IOException
+   * @throws ClassNotFoundException
+   */
+  public Object requestToServer(InetSocketAddress ipAddr, Object request, int timeout,
+      boolean replyExpected) throws IOException, ClassNotFoundException {
+    /*
+     * InetSocketAddress ipAddr; if (addr == null) { ipAddr = new InetSocketAddress(port); } else {
+     * ipAddr = new InetSocketAddress(addr, port); // fix for bug 30810 }
+     */
 
     long giveupTime = System.currentTimeMillis() + timeout;
 
@@ -209,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/92f27080/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..a9505c1 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 (this.hostname != null) {
+      boolean isIpString = InetAddressValidator.getInstance().isValid(this.hostname);
+      if (isIpString) {
+        if (this.host == null) {
+          this.host = InetAddress.getByName(this.hostname);
+        }
+        return new InetSocketAddress(this.host, this.port);
+      }
+    }
+
+    if (this.hostname == null) {
+      if (this.host != null) {
+        return new InetSocketAddress(this.host, this.port);
+      }
+      throw new UnknownHostException("locator ID has no hostname or resolved inet address");
+    }
+    return new InetSocketAddress(this.hostname, this.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/92f27080/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/92f27080/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/92f27080/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..d55399b 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> locatorAddresses = 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);
+    locatorAddresses.add(new HostAddress(isa, host));
+    return this;
   }
 
   public PoolFactory addServer(String host, int port) {
@@ -260,7 +265,8 @@ 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);
+    this.attributes.servers.add(getInetSocketAddress(host, port));
+    return this;
   }
 
   public PoolFactory reset() {
@@ -295,7 +301,9 @@ public class PoolFactoryImpl implements PoolFactory {
     setSubscriptionAckInterval(cp.getSubscriptionAckInterval());
     setServerGroup(cp.getServerGroup());
     setMultiuserAuthentication(cp.getMultiuserAuthentication());
-    this.attributes.locators.addAll(cp.getLocators());
+    for (InetSocketAddress inetSocketAddress : cp.getLocators()) {
+      addLocator(inetSocketAddress.getHostName(), inetSocketAddress.getPort());
+    }
     this.attributes.servers.addAll(cp.getServers());
   }
 
@@ -327,7 +335,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.locatorAddresses);
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/geode/blob/92f27080/geode-core/src/main/java/org/apache/geode/management/internal/JmxManagerLocatorRequest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/JmxManagerLocatorRequest.java b/geode-core/src/main/java/org/apache/geode/management/internal/JmxManagerLocatorRequest.java
index 0efba01..eb71d38 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/JmxManagerLocatorRequest.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/JmxManagerLocatorRequest.java
@@ -18,6 +18,7 @@ import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
 import java.net.InetAddress;
+import java.net.InetSocketAddress;
 import java.util.Map;
 import java.util.Properties;
 
@@ -71,6 +72,7 @@ public class JmxManagerLocatorRequest implements DataSerializableFixedID {
       Map<String, String> sslConfigProps) throws IOException {
     Properties distributionConfigProps = new Properties();
     InetAddress networkAddress = InetAddress.getByName(locatorHost);
+    InetSocketAddress inetSockAddr = new InetSocketAddress(networkAddress, locatorPort);
 
     try {
       if (sslConfigProps != null) {
@@ -78,8 +80,7 @@ public class JmxManagerLocatorRequest implements DataSerializableFixedID {
       }
 
       TcpClient client = new TcpClient(new DistributionConfigImpl(distributionConfigProps));
-      Object responseFromServer =
-          client.requestToServer(networkAddress, locatorPort, SINGLETON, msTimeout);
+      Object responseFromServer = client.requestToServer(inetSockAddr, SINGLETON, msTimeout, true);
 
       return (JmxManagerLocatorResponse) responseFromServer;
     } catch (ClassNotFoundException unexpected) {

http://git-wip-us.apache.org/repos/asf/geode/blob/92f27080/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/LauncherLifecycleCommands.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/LauncherLifecycleCommands.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/LauncherLifecycleCommands.java
index 88832ba..b325e18 100755
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/LauncherLifecycleCommands.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/LauncherLifecycleCommands.java
@@ -101,6 +101,7 @@ import java.io.FileWriter;
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.net.InetAddress;
+import java.net.InetSocketAddress;
 import java.net.MalformedURLException;
 import java.util.ArrayList;
 import java.util.Arrays;

http://git-wip-us.apache.org/repos/asf/geode/blob/92f27080/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/92f27080/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 3cc3cfc..5c33468 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;
@@ -45,15 +49,21 @@ import org.junit.Test;
 import org.junit.contrib.java.lang.system.RestoreSystemProperties;
 import org.junit.experimental.categories.Category;
 
+import junit.framework.Assert;
+
 import java.io.IOException;
 import java.net.ConnectException;
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
 import java.net.UnknownHostException;
 import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
 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;
@@ -65,6 +75,7 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.fail;
 
 import org.awaitility.Awaitility;
+import org.awaitility.Duration;
 
 /**
  *
@@ -108,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);
   }
 
@@ -141,6 +156,77 @@ public class AutoConnectionSourceImplJUnitTest {
     }
   }
 
+  /**
+   * This test validates the AutoConnectionSourceImpl.updateLocatorInLocatorList method. That method
+   * takes InetSocketAddres of locator which unable to connect to locator. And update that
+   * InetSocketAddres with hostaddress of locator in locatorlist.
+   * 
+   * In this test we validate this using identityHashCode.
+   */
+  @Test
+  public void testLocatorIpChange() {
+    int port = 11011;
+    List<InetSocketAddress> locators = new ArrayList();
+    InetSocketAddress floc1 = new InetSocketAddress("fakeLocalHost1", port);
+    InetSocketAddress floc2 = new InetSocketAddress("fakeLocalHost2", port);
+
+    locators.add(floc1);
+    locators.add(floc2);
+
+    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(new HostAddress(floc1, floc1.getHostName()));
+
+    List<InetSocketAddress> cLocList = src.getCurrentLocators();
+
+    Assert.assertEquals(2, cLocList.size());
+
+    Iterator<InetSocketAddress> itr = cLocList.iterator();
+
+    while (itr.hasNext()) {
+      InetSocketAddress t = itr.next();
+      Assert.assertFalse("Should have replaced floc1 intsance", t == floc1);
+    }
+  }
+
+  /**
+   * This test validates the AutoConnectionSourceImpl.addbadLocators method. That method adds
+   * badLocator from badLocator list to new Locator list. And it make sure that new locator list
+   * doesn't have similar entry. For that it checks hostname and port only.
+   */
+  @Test
+  public void testAddBadLocator() {
+    int port = 11011;
+    List<InetSocketAddress> locators = new ArrayList();
+    InetSocketAddress floc1 = new InetSocketAddress("fakeLocalHost1", port);
+    InetSocketAddress floc2 = new InetSocketAddress("fakeLocalHost2", port);
+    locators.add(floc1);
+    locators.add(floc2);
+    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);
+
+
+    InetSocketAddress b1 = new InetSocketAddress("fakeLocalHost1", port);
+    InetSocketAddress b2 = new InetSocketAddress("fakeLocalHost3", port);
+
+    Set<HostAddress> bla = new HashSet<>();
+    bla.add(new HostAddress(b1, b1.getHostName()));
+    bla.add(new HostAddress(b2, b2.getHostName()));
+
+
+    src.addbadLocators(la, bla);
+
+    System.out.println("new locatores " + la);
+    Assert.assertEquals(3, la.size());
+  }
+
   @Test
   public void testNoRespondingLocators() {
     try {
@@ -212,8 +298,13 @@ 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 {
+  public void test_DiscoverLocators_whenOneLocatorWasShutdown() throws Exception {
     startFakeLocator();
     int secondPort = AvailablePortHelper.getRandomAvailableTCPPort();
     TcpServer server2 = new TcpServer(secondPort, InetAddress.getLocalHost(), null, null, handler,
@@ -246,6 +337,35 @@ 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(() -> {
+            return source.getOnlineLocators().isEmpty();
+          });
+      startFakeLocator();
+
+      server.join(1000);
+
+      Awaitility.await().atMost(5000, TimeUnit.MILLISECONDS).until(() -> {
+
+        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",

http://git-wip-us.apache.org/repos/asf/geode/blob/92f27080/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..525f988 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,8 +342,8 @@ public class DistributionConfigJUnitTest {
     assertEquals(config.getStartLocator(), address);
   }
 
-  @Test(expected = InternalGemFireException.class)
-  public void testInvalidLocatorAddress() {
+  @Test
+  public void testInvalidLocatorAddressDoesntThrowException() {
     String address = "bad.bad[7056]";
     config.modifiable = true;
     // config.setStartLocator(address);

http://git-wip-us.apache.org/repos/asf/geode/blob/92f27080/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/92f27080/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 20d2e95..d8c12e2 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/92f27080/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/92f27080/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/92f27080/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/92f27080/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/92f27080/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/92f27080/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