You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ec...@apache.org on 2021/06/22 18:52:32 UTC

[geode] branch revert/1.13 created (now 2249dd1)

This is an automated email from the ASF dual-hosted git repository.

echobravo pushed a change to branch revert/1.13
in repository https://gitbox.apache.org/repos/asf/geode.git.


      at 2249dd1  Revert "GEODE-7861: Improve error reporting in GMSJoinLeave.join() (#5839)"

This branch includes the following new commits:

     new eafe320  Revert "clean up"
     new 18af49f  Revert "GEODE-8206: CI Failure: ReconnectWithClusterConfigurationDUnitTest.testReconnectAfterMeltdown hang (#5192)"
     new c4ebf58  Revert "spA changes"
     new 4e61081  Revert "GEODE-9139 SSLException in starting up a Locator (#6308)"
     new 2249dd1  Revert "GEODE-7861: Improve error reporting in GMSJoinLeave.join() (#5839)"

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[geode] 04/05: Revert "GEODE-9139 SSLException in starting up a Locator (#6308)"

Posted by ec...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

echobravo pushed a commit to branch revert/1.13
in repository https://gitbox.apache.org/repos/asf/geode.git

commit 4e610818af9a34f7d9948188ac98f2a4b4f06ce2
Author: Ernest Burghardt <eb...@pivotal.io>
AuthorDate: Tue Jun 22 13:49:51 2021 -0500

    Revert "GEODE-9139 SSLException in starting up a Locator (#6308)"
    
    This reverts commit a55e472e9fdeb4b0373199463119b340b0cf90a3.
---
 .../client/sni/ClientSNICQAcceptanceTest.java      |  18 ++--
 .../client/sni/DualServerSNIAcceptanceTest.java    |  28 +-----
 .../client/sni/GenerateSNIKeyAndTrustStores.java   |   7 +-
 .../client/sni/dual-server-docker-compose.yml      |  70 ---------------
 .../geode/client/sni/dual-server-haproxy.cfg       |  44 ---------
 .../sni/geode-config/locator-maeve-keystore.jks    | Bin 3514 -> 3529 bytes
 .../geode-config/server-clementine-keystore.jks    | Bin 3520 -> 3537 bytes
 .../sni/geode-config/server-dolores-keystore.jks   | Bin 3515 -> 3533 bytes
 .../geode/client/sni/geode-config/truststore.jks   | Bin 1129 -> 1129 bytes
 .../geode/client/sni/scripts/create-regions.gfsh   |  20 -----
 .../geode/client/sni/scripts/geode-starter-2.gfsh  |  23 +++++
 .../geode/client/sni/scripts/geode-starter.gfsh    |   2 +-
 .../geode/client/sni/scripts/locator-maeve.gfsh    |  18 ----
 .../client/sni/scripts/server-clementine.gfsh      |  18 ----
 .../geode/client/sni/scripts/server-dolores.gfsh   |  18 ----
 .../StartLocatorCommandIntegrationTest.java        |   8 +-
 ...ReconnectWithClusterConfigurationDUnitTest.java |   5 +-
 ...torClusterManagementServiceIntegrationTest.java |  40 ++-------
 .../internal/InternalLocatorIntegrationTest.java   |   8 +-
 .../internal/membership/MembershipJUnitTest.java   |   9 +-
 .../java/org/apache/geode/distributed/Locator.java |  39 +++-----
 .../apache/geode/distributed/LocatorLauncher.java  |  78 +++++++---------
 .../internal/InternalDistributedSystem.java        |   6 +-
 .../distributed/internal/InternalLocator.java      |  66 +++++---------
 .../geode/distributed/internal/ServerLocator.java  |   7 +-
 .../internal/membership/adapter/ServiceConfig.java |   5 +-
 .../apache/geode/internal/DistributionLocator.java |  30 ++++---
 .../admin/remote/DistributionLocatorId.java        |   7 +-
 .../apache/geode/internal/net/SocketCreator.java   |  11 +++
 .../org/apache/geode/internal/tcp/Connection.java  |   8 +-
 .../internal/cli/commands/StartLocatorCommand.java |   9 +-
 .../internal/cli/shell/JmxOperationInvoker.java    |   3 +-
 .../locator/GMSLocatorRecoveryIntegrationTest.java |   5 +-
 .../gms/membership/GMSJoinLeaveJUnitTest.java      |   2 +-
 .../membership/api/MembershipLocatorBuilder.java   |   4 +-
 .../internal/membership/gms/GMSMemberData.java     |   2 +
 .../gms/MembershipLocatorBuilderImpl.java          |   6 +-
 .../membership/gms/locator/GMSLocator.java         |   7 +-
 .../gms/locator/MembershipLocatorImpl.java         |   8 +-
 .../membership/gms/messenger/JGroupsMessenger.java |   7 +-
 .../internal/tcpserver/HostAddress.java            |  56 ------------
 .../internal/tcpserver/HostAndPort.java            |  81 ++++++++++++++---
 .../internal/tcpserver/InetSocketWrapper.java      | 100 ---------------------
 .../geode/internal/cache/wan/WANTestBase.java      |   3 +-
 44 files changed, 250 insertions(+), 636 deletions(-)

diff --git a/geode-assembly/src/acceptanceTest/java/org/apache/geode/client/sni/ClientSNICQAcceptanceTest.java b/geode-assembly/src/acceptanceTest/java/org/apache/geode/client/sni/ClientSNICQAcceptanceTest.java
index dfe1951..e1943d5 100644
--- a/geode-assembly/src/acceptanceTest/java/org/apache/geode/client/sni/ClientSNICQAcceptanceTest.java
+++ b/geode-assembly/src/acceptanceTest/java/org/apache/geode/client/sni/ClientSNICQAcceptanceTest.java
@@ -115,19 +115,11 @@ public class ClientSNICQAcceptanceTest {
   }
 
   @AfterClass
-  public static void afterClass() {
-    printlog("locator-maeve");
-    printlog("server-dolores");
-  }
-
-  private static void printlog(String name) {
-    try {
-      String output =
-          docker.get().exec(options("-T"), "geode",
-              arguments("cat", name + "/" + name + ".log"));
-      System.out.println(name + " log file--------------------------------\n" + output);
-    } catch (Throwable ignore) {
-    }
+  public static void afterClass() throws Exception {
+    String output =
+        docker.get().exec(options("-T"), "geode",
+            arguments("cat", "server-dolores/server-dolores.log"));
+    System.out.println("Server log file--------------------------------\n" + output);
   }
 
   @Before
diff --git a/geode-assembly/src/acceptanceTest/java/org/apache/geode/client/sni/DualServerSNIAcceptanceTest.java b/geode-assembly/src/acceptanceTest/java/org/apache/geode/client/sni/DualServerSNIAcceptanceTest.java
index 7423b95..7b08be2 100644
--- a/geode-assembly/src/acceptanceTest/java/org/apache/geode/client/sni/DualServerSNIAcceptanceTest.java
+++ b/geode-assembly/src/acceptanceTest/java/org/apache/geode/client/sni/DualServerSNIAcceptanceTest.java
@@ -31,7 +31,6 @@ import java.util.Properties;
 
 import com.palantir.docker.compose.DockerComposeRule;
 import org.junit.After;
-import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.ClassRule;
 import org.junit.Test;
@@ -61,7 +60,7 @@ import org.apache.geode.cache.client.proxy.ProxySocketFactories;
 public class DualServerSNIAcceptanceTest {
 
   private static final URL DOCKER_COMPOSE_PATH =
-      DualServerSNIAcceptanceTest.class.getResource("dual-server-docker-compose.yml");
+      SingleServerSNIAcceptanceTest.class.getResource("docker-compose.yml");
 
   // Docker compose does not work on windows in CI. Ignore this test on windows
   // Using a RuleChain to make sure we ignore the test before the rule comes into play
@@ -75,17 +74,8 @@ public class DualServerSNIAcceptanceTest {
 
   @BeforeClass
   public static void beforeClass() throws Exception {
-    docker.get().exec(options("-T"), "locator-maeve",
-        arguments("gfsh", "run", "--file=/geode/scripts/locator-maeve.gfsh"));
-
-    docker.get().exec(options("-T"), "server-dolores",
-        arguments("gfsh", "run", "--file=/geode/scripts/server-dolores.gfsh"));
-
-    docker.get().exec(options("-T"), "server-clementine",
-        arguments("gfsh", "run", "--file=/geode/scripts/server-clementine.gfsh"));
-
-    docker.get().exec(options("-T"), "locator-maeve",
-        arguments("gfsh", "run", "--file=/geode/scripts/create-regions.gfsh"));
+    docker.get().exec(options("-T"), "geode",
+        arguments("gfsh", "run", "--file=/geode/scripts/geode-starter-2.gfsh"));
 
     final String trustStorePath =
         createTempFileFromResource(SingleServerSNIAcceptanceTest.class,
@@ -107,18 +97,6 @@ public class DualServerSNIAcceptanceTest {
     ensureCacheClosed();
   }
 
-  @AfterClass
-  public static void afterClass() throws Exception {
-    // if you need to capture logs for one of the processes use this pattern:
-    // try {
-    // String output =
-    // docker.get().exec(options("-T"), "locator-maeve",
-    // arguments("cat", "locator-maeve/locator-maeve.log"));
-    // System.out.println("Locator log file--------------------------------\n" + output);
-    // } catch (Throwable ignore) {
-    // }
-  }
-
   @Test
   public void successfulRoutingTest() {
     verifyPutAndGet("group-dolores", "region-dolores");
diff --git a/geode-assembly/src/acceptanceTest/java/org/apache/geode/client/sni/GenerateSNIKeyAndTrustStores.java b/geode-assembly/src/acceptanceTest/java/org/apache/geode/client/sni/GenerateSNIKeyAndTrustStores.java
index b48054a..1e5168c 100644
--- a/geode-assembly/src/acceptanceTest/java/org/apache/geode/client/sni/GenerateSNIKeyAndTrustStores.java
+++ b/geode-assembly/src/acceptanceTest/java/org/apache/geode/client/sni/GenerateSNIKeyAndTrustStores.java
@@ -15,6 +15,7 @@
 package org.apache.geode.client.sni;
 
 import java.io.File;
+import java.net.InetAddress;
 import java.net.URL;
 
 import org.apache.geode.cache.ssl.CertStores;
@@ -50,8 +51,10 @@ public class GenerateSNIKeyAndTrustStores {
       CertificateMaterial certificate = new CertificateBuilder(365 * 100, "SHA256withRSA")
           .commonName(certName)
           .issuedBy(ca)
-          .sanDnsName(certName)
-          .sanDnsName("geode")
+          .sanDnsName("geode") // for inside the docker container
+          .sanDnsName("localhost") // for inside the docker container
+          .sanIpAddress(InetAddress.getByName("0.0.0.0")) // for inside the docker container
+          .sanDnsName(certName) // for client endpoint validation
           .generate();
 
       CertStores store = new CertStores(certName);
diff --git a/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/dual-server-docker-compose.yml b/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/dual-server-docker-compose.yml
deleted file mode 100644
index f22e60a..0000000
--- a/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/dual-server-docker-compose.yml
+++ /dev/null
@@ -1,70 +0,0 @@
-#
-# 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.
-#
-version: '3.5'
-services:
-  locator-maeve:
-    container_name: 'locator-maeve'
-    image: 'geode:develop'
-    hostname: locator-maeve
-    expose:
-      - '10334'
-    entrypoint: 'sh'
-    command: '-c /geode/scripts/forever'
-    networks:
-      geode-sni-test:
-    volumes:
-      - ./geode-config:/geode/config:ro
-      - ./scripts:/geode/scripts
-  server-clementine:
-    container_name: 'server-clementine'
-    image: 'geode:develop'
-    hostname: server-clementine
-    expose:
-      - '8501'
-    entrypoint: 'sh'
-    command: '-c /geode/scripts/forever'
-    networks:
-      geode-sni-test:
-    volumes:
-      - ./geode-config:/geode/config:ro
-      - ./scripts:/geode/scripts
-  server-dolores:
-    container_name: 'server-dolores'
-    image: 'geode:develop'
-    hostname: server-dolores
-    expose:
-      - '8502'
-    entrypoint: 'sh'
-    command: '-c /geode/scripts/forever'
-    networks:
-      geode-sni-test:
-    volumes:
-      - ./geode-config:/geode/config:ro
-      - ./scripts:/geode/scripts
-  haproxy:
-    container_name: 'haproxy'
-    image: 'haproxy:2.1'
-    ports:
-      - "15443"
-    networks:
-      geode-sni-test:
-    volumes:
-      - ./dual-server-haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro
-networks:
-  geode-sni-test:
-    name: geode-sni-test
-
diff --git a/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/dual-server-haproxy.cfg b/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/dual-server-haproxy.cfg
deleted file mode 100644
index 130f804..0000000
--- a/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/dual-server-haproxy.cfg
+++ /dev/null
@@ -1,44 +0,0 @@
-#
-# 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.
-#
-
-defaults
-  timeout client 1000
-  timeout connect 1000
-  timeout server 1000
-
-frontend sniproxy
-  bind *:15443
-  mode tcp
-  tcp-request inspect-delay 5s
-  tcp-request content accept if { req_ssl_hello_type 1 }
-  use_backend locators-maeve if { req.ssl_sni -i locator-maeve }
-  use_backend servers-dolores if { req.ssl_sni -i server-dolores }
-  use_backend servers-clementine if { req.ssl_sni -i server-clementine }
-  default_backend locators-maeve
-  log stdout format raw  local0  debug
-
-backend locators-maeve
-  mode tcp
-  server locator1 locator-maeve:10334
-
-backend servers-dolores
-  mode tcp
-  server server1 server-dolores:8501
-
-backend servers-clementine
-  mode tcp
-  server server1 server-clementine:8502
diff --git a/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/geode-config/locator-maeve-keystore.jks b/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/geode-config/locator-maeve-keystore.jks
index cce17bd..ec2feb8 100644
Binary files a/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/geode-config/locator-maeve-keystore.jks and b/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/geode-config/locator-maeve-keystore.jks differ
diff --git a/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/geode-config/server-clementine-keystore.jks b/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/geode-config/server-clementine-keystore.jks
index 5eb5b88..626269d 100644
Binary files a/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/geode-config/server-clementine-keystore.jks and b/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/geode-config/server-clementine-keystore.jks differ
diff --git a/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/geode-config/server-dolores-keystore.jks b/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/geode-config/server-dolores-keystore.jks
index 490c75a..54de8d6 100644
Binary files a/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/geode-config/server-dolores-keystore.jks and b/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/geode-config/server-dolores-keystore.jks differ
diff --git a/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/geode-config/truststore.jks b/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/geode-config/truststore.jks
index 69b4346..a381a9a 100644
Binary files a/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/geode-config/truststore.jks and b/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/geode-config/truststore.jks differ
diff --git a/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/scripts/create-regions.gfsh b/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/scripts/create-regions.gfsh
deleted file mode 100644
index 53b601d..0000000
--- a/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/scripts/create-regions.gfsh
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# 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.
-#
-
-connect --locator=locator-maeve[10334] --use-ssl=true --security-properties-file=/geode/config/gfsecurity.properties
-create region --name=region-dolores --group=group-dolores --type=REPLICATE
-create region --name=region-clementine --group=group-clementine --type=REPLICATE
diff --git a/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/scripts/geode-starter-2.gfsh b/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/scripts/geode-starter-2.gfsh
new file mode 100644
index 0000000..d640a77
--- /dev/null
+++ b/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/scripts/geode-starter-2.gfsh
@@ -0,0 +1,23 @@
+#
+# 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.
+#
+
+start locator --name=locator-maeve --connect=false --redirect-output --hostname-for-clients=locator-maeve --properties-file=/geode/config/gemfire.properties --security-properties-file=/geode/config/gfsecurity.properties --J=-Dgemfire.ssl-keystore=/geode/config/locator-maeve-keystore.jks
+start server --name=server-dolores --group=group-dolores --hostname-for-clients=server-dolores --locators=geode[10334] --properties-file=/geode/config/gemfire.properties --security-properties-file=/geode/config/gfsecurity.properties --J=-Dgemfire.ssl-keystore=/geode/config/server-dolores-keystore.jks
+start server --name=server-clementine --group=group-clementine --hostname-for-clients=server-clementine --server-port=40405 --locators=geode[10334] --properties-file=/geode/config/gemfire.properties --security-properties-file=/geode/config/gfsecurity.properties --J=-Dgemfire.ssl-keystore=/geode/config/server-clementine-keystore.jks
+connect --locator=geode[10334] --use-ssl=true --security-properties-file=/geode/config/gfsecurity.properties
+create region --name=region-dolores --group=group-dolores --type=REPLICATE
+create region --name=region-clementine --group=group-clementine --type=REPLICATE
diff --git a/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/scripts/geode-starter.gfsh b/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/scripts/geode-starter.gfsh
index fa2c0d4..bd89a37 100644
--- a/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/scripts/geode-starter.gfsh
+++ b/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/scripts/geode-starter.gfsh
@@ -15,7 +15,7 @@
 # limitations under the License.
 #
 
-start locator --name=locator-maeve --connect=false --hostname-for-clients=locator-maeve --jmx-manager-hostname-for-clients=geode --properties-file=/geode/config/gemfire.properties --security-properties-file=/geode/config/gfsecurity.properties --J=-Dgemfire.ssl-keystore=/geode/config/locator-maeve-keystore.jks
+start locator --name=locator-maeve --connect=false --hostname-for-clients=locator-maeve --properties-file=/geode/config/gemfire.properties --security-properties-file=/geode/config/gfsecurity.properties --J=-Dgemfire.ssl-keystore=/geode/config/locator-maeve-keystore.jks
 start server --name=server-dolores --max-heap=256m --hostname-for-clients=server-dolores --locators=geode[10334] --properties-file=/geode/config/gemfire.properties --security-properties-file=/geode/config/gfsecurity.properties --J=-Dgemfire.ssl-keystore=/geode/config/server-dolores-keystore.jks
 connect --locator=geode[10334] --use-ssl=true --security-properties-file=/geode/config/gfsecurity.properties
 create region --name=jellyfish --type=REPLICATE
diff --git a/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/scripts/locator-maeve.gfsh b/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/scripts/locator-maeve.gfsh
deleted file mode 100644
index bcf3224..0000000
--- a/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/scripts/locator-maeve.gfsh
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# 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.
-#
-
-start locator --name=locator-maeve --connect=false --redirect-output --bind-address=locator-maeve --http-service-bind-address=locator-maeve --jmx-manager-hostname-for-clients=locator-maeve --hostname-for-clients=locator-maeve --properties-file=/geode/config/gemfire.properties --security-properties-file=/geode/config/gfsecurity.properties --J=-Dgemfire.ssl-keystore=/geode/config/locator-maeve-keystore.jks --J=-Dgemfire.forceDnsUse=true --J=-Djdk.tls.trustNameService=true
diff --git a/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/scripts/server-clementine.gfsh b/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/scripts/server-clementine.gfsh
deleted file mode 100644
index 0922445..0000000
--- a/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/scripts/server-clementine.gfsh
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# 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.
-#
-
-start server --name=server-clementine --group=group-clementine --bind-address=server-clementine --http-service-bind-address=server-clementine --hostname-for-clients=server-clementine --server-port=8502 --locators=locator-maeve[10334] --properties-file=/geode/config/gemfire.properties --security-properties-file=/geode/config/gfsecurity.properties --J=-Dgemfire.ssl-keystore=/geode/config/server-clementine-keystore.jks --J=-Dgemfire.forceDnsUse=true --J=-Djdk.tls.trustNameService=true
diff --git a/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/scripts/server-dolores.gfsh b/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/scripts/server-dolores.gfsh
deleted file mode 100644
index 4f128f5..0000000
--- a/geode-assembly/src/acceptanceTest/resources/org/apache/geode/client/sni/scripts/server-dolores.gfsh
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# 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.
-#
-
-start server --name=server-dolores --group=group-dolores --bind-address=server-dolores --http-service-bind-address=server-dolores --hostname-for-clients=server-dolores --server-port=8501 --locators=locator-maeve[10334] --properties-file=/geode/config/gemfire.properties --security-properties-file=/geode/config/gfsecurity.properties --J=-Dgemfire.ssl-keystore=/geode/config/server-dolores-keystore.jks --J=-Dgemfire.forceDnsUse=true --J=-Djdk.tls.trustNameService=true
diff --git a/geode-assembly/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/StartLocatorCommandIntegrationTest.java b/geode-assembly/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/StartLocatorCommandIntegrationTest.java
index b81625e..59aaa80 100644
--- a/geode-assembly/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/StartLocatorCommandIntegrationTest.java
+++ b/geode-assembly/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/StartLocatorCommandIntegrationTest.java
@@ -22,8 +22,6 @@ import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 
-import java.io.InputStream;
-import java.io.OutputStream;
 import java.util.Properties;
 
 import org.junit.Before;
@@ -81,11 +79,7 @@ public class StartLocatorCommandIntegrationTest {
 
   @Test
   public void startWithBindAddress() throws Exception {
-    final Process mockProcess = mock(Process.class);
-    doReturn(mock(InputStream.class)).when(mockProcess).getInputStream();
-    doReturn(mock(InputStream.class)).when(mockProcess).getErrorStream();
-    doReturn(mock(OutputStream.class)).when(mockProcess).getOutputStream();
-    doReturn(mockProcess).when(spy).getProcess(any(), any());
+    doReturn(mock(Process.class)).when(spy).getProcess(any(), any());
     commandRule.executeAndAssertThat(spy, "start locator --bind-address=127.0.0.1");
 
     ArgumentCaptor<String[]> commandLines = ArgumentCaptor.forClass(String[].class);
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithClusterConfigurationDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithClusterConfigurationDUnitTest.java
index b67bc55..d2c6d95 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithClusterConfigurationDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithClusterConfigurationDUnitTest.java
@@ -47,7 +47,6 @@ import org.apache.geode.distributed.Locator;
 import org.apache.geode.distributed.internal.InternalConfigurationPersistenceService;
 import org.apache.geode.distributed.internal.InternalLocator;
 import org.apache.geode.distributed.internal.membership.api.MembershipManagerHelper;
-import org.apache.geode.distributed.internal.tcpserver.HostAddress;
 import org.apache.geode.internal.AvailablePort;
 import org.apache.geode.internal.AvailablePortHelper;
 import org.apache.geode.test.awaitility.GeodeAwaitility;
@@ -89,9 +88,7 @@ public class ReconnectWithClusterConfigurationDUnitTest implements Serializable
           Disconnect.disconnectFromDS();
           dsProperties = null;
           Properties props = getDistributedSystemProperties();
-          locator = InternalLocator.startLocator(locatorPorts[locatorNumber], new File(""),
-              null, null, new HostAddress(LocalHostUtil.getLocalHost()), true,
-              props, null, Paths.get(workingDir));
+          locator = Locator.startLocatorAndDS(locatorPorts[locatorNumber], new File(""), props);
           system = locator.getDistributedSystem();
           cache = ((InternalLocator) locator).getCache();
           IgnoredException.addIgnoredException(
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/InternalLocatorClusterManagementServiceIntegrationTest.java b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/InternalLocatorClusterManagementServiceIntegrationTest.java
index e4b67af..0e0226e 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/InternalLocatorClusterManagementServiceIntegrationTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/InternalLocatorClusterManagementServiceIntegrationTest.java
@@ -32,7 +32,6 @@ import org.junit.Test;
 
 import org.apache.geode.cache.RegionShortcut;
 import org.apache.geode.cache.internal.HttpService;
-import org.apache.geode.distributed.internal.tcpserver.HostAddress;
 import org.apache.geode.internal.AvailablePortHelper;
 import org.apache.geode.internal.cache.InternalCacheForClientAccess;
 import org.apache.geode.internal.cache.InternalRegionFactory;
@@ -44,40 +43,11 @@ import org.apache.geode.management.internal.BaseManagementService;
 public class InternalLocatorClusterManagementServiceIntegrationTest {
 
   private InternalLocator internalLocator; // the instance under test
-  private DistributionConfigImpl distributionConfig;
-  private InternalCacheForClientAccess cache;
-  private BaseManagementService managementService;
-  private AgentUtil agentUtil;
-  private HttpService httpService;
-
-  @Before
-  public void setup() throws URISyntaxException {
-    distributionConfig = mock(DistributionConfigImpl.class);
-    cache = mock(InternalCacheForClientAccess.class);
-    managementService = mock(BaseManagementService.class);
-    agentUtil = mock(AgentUtil.class);
-    httpService = mock(HttpService.class);
-    InternalRegionFactory regionFactory = mock(InternalRegionFactory.class);
-    LoggingSession loggingSession = mock(LoggingSession.class);
-    URI uri = new URI("file", "/management.war", null);
-
-    when(distributionConfig.getJmxManager()).thenReturn(true);
-    when(distributionConfig.getJmxManagerPort())
-        .thenReturn(AvailablePortHelper.getRandomAvailableTCPPort());
-    when(distributionConfig.getLocators()).thenReturn("");
-    when(distributionConfig.getSecurableCommunicationChannels())
-        .thenReturn(new SecurableCommunicationChannel[] {});
-    when(distributionConfig.getSecurityAuthTokenEnabledComponents()).thenReturn(new String[] {});
-    when(cache.createInternalRegionFactory(RegionShortcut.REPLICATE)).thenReturn(regionFactory);
-    when(cache.getOptionalService(HttpService.class))
-        .thenReturn(Optional.of(httpService));
-    when(cache.getCacheForProcessingClientRequests()).thenReturn(cache);
-    when(agentUtil.findWarLocation("geode-web-management")).thenReturn(uri);
-    BaseManagementService.setManagementService(cache, managementService);
-
-    internalLocator = new InternalLocator(0, loggingSession, null, null, null, (HostAddress) null,
-        null, null, distributionConfig, null);
-  }
+  private DistributionConfigImpl distributionConfig = mock(DistributionConfigImpl.class);
+  private InternalCacheForClientAccess cache = mock(InternalCacheForClientAccess.class);
+  private BaseManagementService managementService = mock(BaseManagementService.class);
+  private AgentUtil agentUtil = mock(AgentUtil.class);
+  private HttpService httpService = mock(HttpService.class);
 
   @After
   public void tearDown() {
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/InternalLocatorIntegrationTest.java b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/InternalLocatorIntegrationTest.java
index 0f3de29..09efe36 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/InternalLocatorIntegrationTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/InternalLocatorIntegrationTest.java
@@ -22,7 +22,6 @@ import static org.mockito.Mockito.when;
 import java.io.File;
 import java.io.IOException;
 import java.net.InetAddress;
-import java.nio.charset.Charset;
 import java.nio.file.Path;
 import java.util.Properties;
 
@@ -39,7 +38,6 @@ import org.mockito.quality.Strictness;
 
 import org.apache.geode.distributed.Locator;
 import org.apache.geode.internal.logging.InternalLogWriter;
-import org.apache.geode.distributed.internal.tcpserver.HostAddress;
 import org.apache.geode.internal.security.SecurableCommunicationChannel;
 import org.apache.geode.logging.internal.LoggingSession;
 
@@ -60,7 +58,7 @@ public class InternalLocatorIntegrationTest {
   private InternalLogWriter logWriter;
   @Mock
   private InternalLogWriter securityLogWriter;
-  private HostAddress bindAddress;
+  private InetAddress bindAddress;
   private String hostnameForClients;
   @Mock
   private Properties distributedSystemProperties;
@@ -100,9 +98,7 @@ public class InternalLocatorIntegrationTest {
     assertThatCode(() -> {
       internalLocator =
           new InternalLocator(port, loggingSession, logFile, logWriter, securityLogWriter,
-              bindAddress,
-              hostnameForClients,
-              distributedSystemProperties, distributionConfig,
+              bindAddress, hostnameForClients, distributedSystemProperties, distributionConfig,
               workingDirectory);
     }).doesNotThrowAnyException();
   }
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/MembershipJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/MembershipJUnitTest.java
index 08f4fe1..cb3c19a 100755
--- a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/MembershipJUnitTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/MembershipJUnitTest.java
@@ -31,6 +31,7 @@ import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
 import java.io.File;
+import java.net.InetAddress;
 import java.util.Comparator;
 import java.util.List;
 import java.util.Properties;
@@ -65,7 +66,6 @@ import org.apache.geode.distributed.internal.membership.api.MembershipListener;
 import org.apache.geode.distributed.internal.membership.api.MembershipLocator;
 import org.apache.geode.distributed.internal.membership.api.MembershipView;
 import org.apache.geode.distributed.internal.membership.api.MessageListener;
-import org.apache.geode.distributed.internal.tcpserver.HostAddress;
 import org.apache.geode.distributed.internal.tcpserver.TcpClient;
 import org.apache.geode.distributed.internal.tcpserver.TcpSocketCreator;
 import org.apache.geode.distributed.internal.tcpserver.TcpSocketFactory;
@@ -137,7 +137,7 @@ public class MembershipJUnitTest {
 
       // boot up a locator
       int port = AvailablePortHelper.getRandomAvailableTCPPort();
-      HostAddress localHost = new HostAddress(LocalHostUtil.getLocalHost());
+      InetAddress localHost = LocalHostUtil.getLocalHost();
 
       // this locator will hook itself up with the first Membership
       // to be created
@@ -328,14 +328,13 @@ public class MembershipJUnitTest {
 
       // boot up a locator
       int port = AvailablePortHelper.getRandomAvailableTCPPort();
-      HostAddress localHost = new HostAddress(LocalHostUtil.getLocalHost());
+      InetAddress localHost = LocalHostUtil.getLocalHost();
       Properties p = new Properties();
       p.setProperty(ConfigurationProperties.SECURITY_UDP_DHALGO, "AES:128");
       // this locator will hook itself up with the first Membership
       // to be created
       internalLocator =
-          InternalLocator.startLocator(port, new File(""), null, null, localHost, false, p,
-              null,
+          InternalLocator.startLocator(port, new File(""), null, null, localHost, false, p, null,
               temporaryFolder.getRoot().toPath());
 
       // create configuration objects
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/Locator.java b/geode-core/src/main/java/org/apache/geode/distributed/Locator.java
index 0a62382..e4b2c98 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/Locator.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/Locator.java
@@ -22,7 +22,6 @@ import java.util.List;
 import java.util.Properties;
 
 import org.apache.geode.distributed.internal.InternalLocator;
-import org.apache.geode.distributed.internal.tcpserver.HostAddress;
 import org.apache.geode.internal.inet.LocalHostUtil;
 
 /**
@@ -64,11 +63,8 @@ public abstract class Locator {
   /** The file to which this locator logs */
   protected File logFile;
 
-  /** no longer used but kept for binary compatibility */
-  protected InetAddress bindAddress;
-
   /** The bind address for this locator */
-  protected HostAddress hostAddress;
+  protected InetAddress bindAddress;
 
   /**
    * the hostname to give to clients so they can connect to this locator.
@@ -105,7 +101,7 @@ public abstract class Locator {
    */
   public static Locator startLocator(int port, File logFile) throws IOException {
 
-    return startLocator(port, logFile, false, null, null, true, true,
+    return startLocator(port, logFile, false, (InetAddress) null, (Properties) null, true, true,
         null);
   }
 
@@ -140,7 +136,7 @@ public abstract class Locator {
   public static Locator startLocatorAndDS(int port, File logFile,
       Properties distributedSystemProperties) throws IOException {
 
-    return startLocator(port, logFile, null, distributedSystemProperties, true, true,
+    return startLocator(port, logFile, (InetAddress) null, distributedSystemProperties, true, true,
         null);
   }
 
@@ -169,9 +165,8 @@ public abstract class Locator {
    */
   public static Locator startLocator(int port, File logFile, InetAddress bindAddress)
       throws IOException {
-    HostAddress hostAddress = bindAddress == null ? null : new HostAddress(bindAddress);
-    return startLocator(port, logFile, false, hostAddress, null, true,
-        true, null);
+
+    return startLocator(port, logFile, false, bindAddress, (Properties) null, true, true, null);
   }
 
 
@@ -203,9 +198,7 @@ public abstract class Locator {
    */
   public static Locator startLocatorAndDS(int port, File logFile, InetAddress bindAddress,
       java.util.Properties dsProperties) throws IOException {
-    HostAddress hostAddress = bindAddress == null ? null : new HostAddress(bindAddress);
-    return startLocator(port, logFile, hostAddress, dsProperties, true, true,
-        null);
+    return startLocator(port, logFile, bindAddress, dsProperties, true, true, null);
   }
 
   /**
@@ -246,16 +239,14 @@ public abstract class Locator {
   public static Locator startLocatorAndDS(int port, File logFile, InetAddress bindAddress,
       java.util.Properties dsProperties, boolean peerLocator, boolean serverLocator,
       String hostnameForClients) throws IOException {
-    HostAddress hostAddress = bindAddress == null ? null : new HostAddress(bindAddress);
-    return startLocator(port, logFile, hostAddress, dsProperties, true, true,
-        hostnameForClients);
+    return startLocator(port, logFile, bindAddress, dsProperties, true, true, hostnameForClients);
   }
 
   /**
    * all Locator methods that start locators should use this method to start the locator and its
    * distributed system
    */
-  private static Locator startLocator(int port, File logFile, HostAddress bindAddress,
+  private static Locator startLocator(int port, File logFile, InetAddress bindAddress,
       java.util.Properties dsProperties, boolean peerLocator, boolean serverLocator,
       String hostnameForClients) throws IOException {
     return InternalLocator.startLocator(port, logFile, null, null, bindAddress, true, dsProperties,
@@ -267,7 +258,7 @@ public abstract class Locator {
    *             peerLocator, serverLocator, hostnameForClients) instead.
    */
   private static Locator startLocator(int port, File logFile, boolean startDistributedSystem,
-      HostAddress bindAddress, java.util.Properties dsProperties, boolean peerLocator,
+      InetAddress bindAddress, java.util.Properties dsProperties, boolean peerLocator,
       boolean serverLocator, String hostnameForClients) throws IOException {
     return InternalLocator.startLocator(port, logFile, null, null, bindAddress,
         startDistributedSystem, dsProperties, hostnameForClients);
@@ -341,7 +332,7 @@ public abstract class Locator {
    * Returns the IP address to which this locator's listening socket is bound.
    */
   public InetAddress getBindAddress() {
-    return bindAddress;
+    return this.bindAddress;
   }
 
   /**
@@ -391,16 +382,14 @@ public abstract class Locator {
    * Get the string representation of this <code>Locator</code> in host[port] format.
    */
   public String asString() {
-    String bindAddressString = null;
-    if (hostAddress == null) {
+    Object ba = this.bindAddress;
+    if (ba == null) {
       try {
-        bindAddressString = LocalHostUtil.getLocalHostName();
+        ba = LocalHostUtil.getLocalHostName();
       } catch (java.net.UnknownHostException uh) {
       }
-    } else {
-      bindAddressString = hostAddress.getHostName();
     }
-    StringBuilder locatorString = new StringBuilder(String.valueOf(bindAddressString));
+    StringBuilder locatorString = new StringBuilder(String.valueOf(ba));
     Integer port = getPort();
     if (port != null && port.intValue() > 0) {
       locatorString.append('[').append(this.getPort()).append(']');
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/LocatorLauncher.java b/geode-core/src/main/java/org/apache/geode/distributed/LocatorLauncher.java
index bab4a14..0cd015e 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/LocatorLauncher.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/LocatorLauncher.java
@@ -60,7 +60,6 @@ import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.client.internal.locator.LocatorStatusRequest;
 import org.apache.geode.cache.client.internal.locator.LocatorStatusResponse;
 import org.apache.geode.distributed.internal.InternalLocator;
-import org.apache.geode.distributed.internal.tcpserver.HostAddress;
 import org.apache.geode.distributed.internal.tcpserver.HostAndPort;
 import org.apache.geode.distributed.internal.tcpserver.TcpClient;
 import org.apache.geode.distributed.internal.tcpserver.TcpSocketCreator;
@@ -188,7 +187,7 @@ public class LocatorLauncher extends AbstractLauncher<String> {
   private final boolean portSpecified;
   private final boolean workingDirectorySpecified;
 
-  private final HostAddress bindAddress;
+  private final InetAddress bindAddress;
 
   private final Integer pid;
   private final Integer port;
@@ -260,7 +259,7 @@ public class LocatorLauncher extends AbstractLauncher<String> {
     this.command = builder.getCommand();
     this.help = Boolean.TRUE.equals(builder.getHelp());
     this.bindAddressSpecified = builder.isBindAddressSpecified();
-    this.bindAddress = builder.getHostAddress();
+    this.bindAddress = builder.getBindAddress();
     setDebug(Boolean.TRUE.equals(builder.getDebug()));
     this.deletePidFileOnStop = Boolean.TRUE.equals(builder.getDeletePidFileOnStop());
     this.distributedSystemProperties = builder.getDistributedSystemProperties();
@@ -298,31 +297,19 @@ public class LocatorLauncher extends AbstractLauncher<String> {
   @Deprecated
   public static LocatorStatusResponse statusLocator(int port, InetAddress bindAddress)
       throws IOException {
-    return statusLocator(port, bindAddress == null ? null : bindAddress.getCanonicalHostName(),
-        new Properties());
-  }
-
-  /**
-   * Returns the status of the locator on the given host & port. If you have endpoint
-   * identification enabled the preferred method is statusForLocator(int, String), which
-   * lets you specify the locator's name that the locator has stored in its TLS certificate
-   */
-  public LocatorStatusResponse statusForLocator(int port, InetAddress bindAddress)
-      throws IOException {
-    return statusLocator(port, bindAddress == null ? null : bindAddress.getCanonicalHostName(),
-        getProperties());
+    return statusLocator(port, bindAddress, new Properties());
   }
 
   /**
    * Returns the status of the locator on the given host & port
    */
-  public LocatorStatusResponse statusForLocator(int port, String hostname)
+  public LocatorStatusResponse statusForLocator(int port, InetAddress bindAddress)
       throws IOException {
-    return statusLocator(port, hostname, getProperties());
+    return statusLocator(port, bindAddress, getProperties());
   }
 
   private static LocatorStatusResponse statusLocator(
-      final int port, String bindAddress,
+      final int port, InetAddress bindAddress,
       final Properties properties)
       throws IOException {
 
@@ -341,7 +328,7 @@ public class LocatorLauncher extends AbstractLauncher<String> {
           TcpSocketFactory.DEFAULT);
 
       return (LocatorStatusResponse) client.requestToServer(
-          new HostAndPort(bindAddress == null ? HostUtils.getLocalHost() : bindAddress, port),
+          new HostAndPort(bindAddress == null ? null : bindAddress.getCanonicalHostName(), port),
           new LocatorStatusRequest(), timeout, true);
     } catch (ClassNotFoundException e) {
       throw new RuntimeException(e);
@@ -442,7 +429,7 @@ public class LocatorLauncher extends AbstractLauncher<String> {
    * @see java.net.InetAddress
    */
   public InetAddress getBindAddress() {
-    return bindAddress == null ? null : bindAddress.getAddress();
+    return this.bindAddress;
   }
 
   /**
@@ -461,9 +448,10 @@ public class LocatorLauncher extends AbstractLauncher<String> {
    */
   protected String getBindAddressAsString() {
     try {
-      if (bindAddress != null) {
-        return bindAddress.getHostName();
+      if (getBindAddress() != null) {
+        return getBindAddress().getCanonicalHostName();
       }
+
       return LocalHostUtil.getCanonicalLocalHostName();
     } catch (UnknownHostException handled) {
       // Returning localhost/127.0.0.1 implies the bindAddress was null and no IP address for
@@ -726,8 +714,7 @@ public class LocatorLauncher extends AbstractLauncher<String> {
 
         try {
           this.locator = InternalLocator.startLocator(getPort(), getLogFile(), null, null,
-              bindAddress, true, getDistributedSystemProperties(),
-              getHostnameForClients(),
+              getBindAddress(), true, getDistributedSystemProperties(), getHostnameForClients(),
               Paths.get(workingDirectory));
         } finally {
           ProcessLauncherContext.remove();
@@ -873,7 +860,7 @@ public class LocatorLauncher extends AbstractLauncher<String> {
 
     while (System.currentTimeMillis() < endTimeInMilliseconds) {
       try {
-        LocatorStatusResponse response = statusForLocator(getPort(), getBindAddressString());
+        LocatorStatusResponse response = statusForLocator(getPort(), getBindAddress());
         return new LocatorState(this, Status.ONLINE, response);
       } catch (Exception handled) {
         timedWait(interval, timeUnit);
@@ -998,7 +985,7 @@ public class LocatorLauncher extends AbstractLauncher<String> {
 
   private LocatorState statusWithPort() {
     try {
-      LocatorStatusResponse response = statusForLocator(getPort(), getBindAddressString());
+      LocatorStatusResponse response = statusForLocator(getPort(), getBindAddress());
       return new LocatorState(this, Status.ONLINE, response);
     } catch (Exception handled) {
       return createNoResponseState(handled,
@@ -1199,10 +1186,6 @@ public class LocatorLauncher extends AbstractLauncher<String> {
     return overriddenDefaults;
   }
 
-  public String getBindAddressString() {
-    return bindAddress == null ? null : bindAddress.getHostName();
-  }
-
   private class LocatorControllerParameters implements ProcessControllerParameters {
     @Override
     public File getPidFile() {
@@ -1277,7 +1260,7 @@ public class LocatorLauncher extends AbstractLauncher<String> {
     private Boolean loadSharedConfigFromDir;
     private Command command;
 
-    private HostAddress bindAddress;
+    private InetAddress bindAddress;
 
     private Integer pid;
     private Integer port;
@@ -1588,18 +1571,14 @@ public class LocatorLauncher extends AbstractLauncher<String> {
      * @see java.net.InetAddress
      */
     public InetAddress getBindAddress() {
-      return bindAddress == null ? null : bindAddress.getAddress();
-    }
-
-    HostAddress getHostAddress() {
-      return bindAddress;
+      return this.bindAddress;
     }
 
     /**
      * Sets the IP address as an java.net.InetAddress to which the Locator has bound itself
      * listening for client requests.
      *
-     * @param addressString the InetAddress with the IP address or hostname on which the Locator is
+     * @param bindAddress the InetAddress with the IP address or hostname on which the Locator is
      *        bound and listening.
      * @return this Builder instance.
      * @throws IllegalArgumentException wrapping the UnknownHostException if the IP address or
@@ -1607,23 +1586,24 @@ public class LocatorLauncher extends AbstractLauncher<String> {
      * @see #getBindAddress()
      * @see java.net.InetAddress
      */
-    public Builder setBindAddress(final String addressString) {
-      if (isBlank(addressString)) {
+    public Builder setBindAddress(final String bindAddress) {
+      if (isBlank(bindAddress)) {
         this.bindAddress = null;
         return this;
       } else {
         try {
-          InetAddress address = InetAddress.getByName(addressString);
+          InetAddress address = InetAddress.getByName(bindAddress);
           if (LocalHostUtil.isLocalHost(address)) {
-            this.bindAddress = new HostAddress(addressString);
+            this.bindAddress = address;
             return this;
           } else {
             throw new IllegalArgumentException(
-                addressString + " is not an address for this machine.");
+                bindAddress + " is not an address for this machine.");
           }
         } catch (UnknownHostException e) {
-          throw new IllegalArgumentException("The hostname/IP address (" + addressString
-              + ") to which the Locator will be bound is unknown.",
+          throw new IllegalArgumentException(
+              String.format("The hostname/IP address to which the %s will be bound is unknown.",
+                  "Locator"),
               e);
         }
       }
@@ -2150,9 +2130,11 @@ public class LocatorLauncher extends AbstractLauncher<String> {
     private static String getBindAddressAsString(LocatorLauncher launcher) {
       if (InternalLocator.hasLocator()) {
         final InternalLocator locator = InternalLocator.getLocator();
-        String bindAddress = locator.getBindAddressString();
-        if (bindAddress != null && !bindAddress.isEmpty()) {
-          return bindAddress;
+        final InetAddress bindAddress = locator.getBindAddress();
+        if (bindAddress != null) {
+          if (isNotBlank(bindAddress.getHostAddress())) {
+            return bindAddress.getHostAddress();
+          }
         }
       }
       return launcher.getBindAddressAsString();
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 847e581..d45df2e 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
@@ -79,7 +79,6 @@ import org.apache.geode.distributed.internal.membership.InternalDistributedMembe
 import org.apache.geode.distributed.internal.membership.api.MembershipInformation;
 import org.apache.geode.distributed.internal.membership.api.MembershipLocator;
 import org.apache.geode.distributed.internal.membership.api.QuorumChecker;
-import org.apache.geode.distributed.internal.tcpserver.HostAddress;
 import org.apache.geode.internal.Assert;
 import org.apache.geode.internal.InternalDataSerializer;
 import org.apache.geode.internal.InternalInstantiator;
@@ -915,9 +914,8 @@ public class InternalDistributedSystem extends DistributedSystem
     try {
       startedLocator =
           InternalLocator.createLocator(locId.getPort(), NullLoggingSession.create(), null,
-              logWriter, securityLogWriter, new HostAddress(locId.getHost()),
-              locId.getHostnameForClients(), originalConfig.toProperties(),
-              false);
+              logWriter, securityLogWriter, locId.getHost().getAddress(),
+              locId.getHostnameForClients(), originalConfig.toProperties(), false);
 
       // if locator is started this way, cluster config is not enabled, set the flag correctly
       startedLocator.getConfig().setEnableClusterConfiguration(false);
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalLocator.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalLocator.java
index 543e1e3..52dad50 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalLocator.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalLocator.java
@@ -23,6 +23,7 @@ import static org.apache.geode.util.internal.GeodeGlossary.GEMFIRE_PREFIX;
 
 import java.io.File;
 import java.io.IOException;
+import java.net.InetAddress;
 import java.net.URI;
 import java.net.UnknownHostException;
 import java.nio.file.Path;
@@ -68,7 +69,6 @@ import org.apache.geode.distributed.internal.membership.api.MembershipConfigurat
 import org.apache.geode.distributed.internal.membership.api.MembershipLocator;
 import org.apache.geode.distributed.internal.membership.api.MembershipLocatorBuilder;
 import org.apache.geode.distributed.internal.membership.api.QuorumChecker;
-import org.apache.geode.distributed.internal.tcpserver.HostAddress;
 import org.apache.geode.distributed.internal.tcpserver.InfoRequest;
 import org.apache.geode.distributed.internal.tcpserver.TcpHandler;
 import org.apache.geode.distributed.internal.tcpserver.TcpServer;
@@ -258,16 +258,13 @@ public class InternalLocator extends Locator implements ConnectListener, LogConf
    * @param startDistributedSystem if true then this locator will also start its own ds
    *
    * @deprecated Please use
-   *             {@link #createLocator(int, LoggingSession, File, InternalLogWriter, InternalLogWriter, HostAddress, String, Properties, Path)}
+   *             {@link #createLocator(int, LoggingSession, File, InternalLogWriter, InternalLogWriter, InetAddress, String, Properties, Path)}
    *             instead.
    */
   @Deprecated
   public static InternalLocator createLocator(int port, LoggingSession loggingSession, File logFile,
-      InternalLogWriter logWriter,
-      InternalLogWriter securityLogWriter,
-      HostAddress bindAddress,
-      String hostnameForClients,
-      Properties distributedSystemProperties,
+      InternalLogWriter logWriter, InternalLogWriter securityLogWriter, InetAddress bindAddress,
+      String hostnameForClients, Properties distributedSystemProperties,
       boolean startDistributedSystem) {
     return createLocator(port, loggingSession, logFile, logWriter, securityLogWriter, bindAddress,
         hostnameForClients, distributedSystemProperties,
@@ -285,18 +282,13 @@ public class InternalLocator extends Locator implements ConnectListener, LogConf
    * @param logFile the file that log messages should be written to
    * @param logWriter a log writer that should be used (logFile parameter is ignored)
    * @param securityLogWriter the logWriter to be used for security related log messages
-   * @param bindAddress the bind address for the locator
    * @param distributedSystemProperties optional properties to configure the distributed system
    *        (e.g., mcast addr/port, other locators)
    * @param workingDirectory the working directory to use for any files
    */
   public static InternalLocator createLocator(int port, LoggingSession loggingSession, File logFile,
-      InternalLogWriter logWriter,
-      InternalLogWriter securityLogWriter,
-      HostAddress bindAddress,
-      String hostnameForClients,
-      Properties distributedSystemProperties,
-      Path workingDirectory) {
+      InternalLogWriter logWriter, InternalLogWriter securityLogWriter, InetAddress bindAddress,
+      String hostnameForClients, Properties distributedSystemProperties, Path workingDirectory) {
     synchronized (locatorLock) {
       if (hasLocator()) {
         throw new IllegalStateException(
@@ -340,7 +332,7 @@ public class InternalLocator extends Locator implements ConnectListener, LogConf
    * @param hostnameForClients the name to give to clients for connecting to this locator
    */
   public static InternalLocator startLocator(int port, File logFile, InternalLogWriter logWriter,
-      InternalLogWriter securityLogWriter, HostAddress bindAddress, boolean startDistributedSystem,
+      InternalLogWriter securityLogWriter, InetAddress bindAddress, boolean startDistributedSystem,
       Properties distributedSystemProperties, String hostnameForClients)
       throws IOException {
     return startLocator(port, logFile, logWriter, securityLogWriter, bindAddress,
@@ -359,7 +351,6 @@ public class InternalLocator extends Locator implements ConnectListener, LogConf
    * @param logFile the file that log messages should be written to
    * @param logWriter a log writer that should be used (logFile parameter is ignored)
    * @param securityLogWriter the logWriter to be used for security related log messages
-   * @param bindAddress the bind address for the locator
    * @param startDistributedSystem if true, a distributed system is started
    * @param distributedSystemProperties optional properties to configure the distributed system
    *        (e.g., mcast
@@ -368,11 +359,8 @@ public class InternalLocator extends Locator implements ConnectListener, LogConf
    * @param workingDirectory the working directory to use for any files
    */
   public static InternalLocator startLocator(int port, File logFile, InternalLogWriter logWriter,
-      InternalLogWriter securityLogWriter,
-      HostAddress bindAddress,
-      boolean startDistributedSystem,
-      Properties distributedSystemProperties,
-      String hostnameForClients, Path workingDirectory)
+      InternalLogWriter securityLogWriter, InetAddress bindAddress, boolean startDistributedSystem,
+      Properties distributedSystemProperties, String hostnameForClients, Path workingDirectory)
       throws IOException {
     System.setProperty(FORCE_LOCATOR_DM_TYPE, "true");
     InternalLocator newLocator = null;
@@ -477,17 +465,11 @@ public class InternalLocator extends Locator implements ConnectListener, LogConf
    */
   @VisibleForTesting
   InternalLocator(int port, LoggingSession loggingSession, File logFile,
-      InternalLogWriter logWriter, InternalLogWriter securityLogWriter,
-      HostAddress hostAddress, String hostnameForClients,
-      Properties distributedSystemProperties,
+      InternalLogWriter logWriter, InternalLogWriter securityLogWriter, InetAddress bindAddress,
+      String hostnameForClients, Properties distributedSystemProperties,
       DistributionConfigImpl distributionConfig, Path workingDirectory) {
     this.logFile = logFile;
-    this.hostAddress = hostAddress;
-    // bindAddress is superceded by hostAddress but must be kept for Locator API backward
-    // compatibility
-    if (hostAddress != null) {
-      this.bindAddress = hostAddress.getAddress();
-    }
+    this.bindAddress = bindAddress;
     this.hostnameForClients = hostnameForClients;
 
     this.workingDirectory = workingDirectory;
@@ -497,8 +479,8 @@ public class InternalLocator extends Locator implements ConnectListener, LogConf
 
     // set bind-address explicitly only if not wildcard and let any explicit
     // value in distributedSystemProperties take precedence
-    if (hostAddress != null) {
-      env.setProperty(BIND_ADDRESS, hostAddress.getHostName());
+    if (bindAddress != null && !bindAddress.isAnyLocalAddress()) {
+      env.setProperty(BIND_ADDRESS, bindAddress.getHostAddress());
     }
 
     if (distributedSystemProperties != null) {
@@ -573,7 +555,7 @@ public class InternalLocator extends Locator implements ConnectListener, LogConf
               executor)
               .setConfig(config)
               .setPort(port)
-              .setBindAddress(hostAddress)
+              .setBindAddress(bindAddress)
               .setProtocolChecker(new ProtocolCheckerImpl(this, new ClientProtocolServiceLoader()))
               .setFallbackHandler(handler)
               .setLocatorsAreCoordinators(shouldLocatorsBeCoordinators())
@@ -693,7 +675,7 @@ public class InternalLocator extends Locator implements ConnectListener, LogConf
    */
   @Deprecated
   public static InternalLocator startLocator(int locatorPort, File logFile,
-      InternalLogWriter logWriter, InternalLogWriter securityLogWriter, HostAddress bindAddress,
+      InternalLogWriter logWriter, InternalLogWriter securityLogWriter, InetAddress bindAddress,
       Properties distributedSystemProperties, boolean peerLocator, boolean serverLocator,
       String hostnameForClients, boolean b1) throws IOException {
     return startLocator(locatorPort, logFile, logWriter, securityLogWriter, bindAddress, true,
@@ -716,8 +698,8 @@ public class InternalLocator extends Locator implements ConnectListener, LogConf
     } else {
 
       StringBuilder sb = new StringBuilder(100);
-      if (hostAddress != null && !StringUtils.isEmpty(hostAddress.getHostName())) {
-        sb.append(hostAddress.getHostName());
+      if (bindAddress != null) {
+        sb.append(bindAddress.getHostAddress());
       } else {
         sb.append(LocalHostUtil.getLocalHost().getCanonicalHostName());
       }
@@ -906,9 +888,8 @@ public class InternalLocator extends Locator implements ConnectListener, LogConf
       }
     }
 
-    ServerLocator serverLocator =
-        new ServerLocator(getPort(), getBindAddressString(), hostnameForClients,
-            logFile, productUseLog, getConfig().getName(), distributedSystem, locatorStats);
+    ServerLocator serverLocator = new ServerLocator(getPort(), bindAddress, hostnameForClients,
+        logFile, productUseLog, getConfig().getName(), distributedSystem, locatorStats);
     restartHandlers.add(serverLocator);
     membershipLocator.addHandler(LocatorListRequest.class, serverLocator);
     membershipLocator.addHandler(ClientConnectionRequest.class, serverLocator);
@@ -1440,13 +1421,6 @@ public class InternalLocator extends Locator implements ConnectListener, LogConf
     return membershipLocator.isHandled(messageClass);
   }
 
-  public String getBindAddressString() {
-    if (hostAddress != null) {
-      return hostAddress.getHostName();
-    }
-    return null;
-  }
-
   class FetchSharedConfigStatus implements Callable<SharedConfigurationStatusResponse> {
 
     @Override
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/ServerLocator.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/ServerLocator.java
index 5064d99..075489f 100755
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/ServerLocator.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/ServerLocator.java
@@ -16,6 +16,7 @@ package org.apache.geode.distributed.internal;
 
 import java.io.File;
 import java.io.IOException;
+import java.net.InetAddress;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
@@ -107,15 +108,15 @@ public class ServerLocator implements TcpHandler, RestartHandler, DistributionAd
     return loadSnapshot;
   }
 
-  public ServerLocator(int port, String bindAddress, String hostNameForClients, File logFile,
+  public ServerLocator(int port, InetAddress bindAddress, String hostNameForClients, File logFile,
       ProductUseLog productUseLogWriter, String memberName, InternalDistributedSystem ds,
       LocatorStats stats) throws IOException {
     this.port = port;
 
-    if (bindAddress == null || bindAddress.isEmpty()) {
+    if (bindAddress == null) {
       this.hostName = LocalHostUtil.getCanonicalLocalHostName();
     } else {
-      this.hostName = bindAddress;
+      this.hostName = bindAddress.getHostAddress();
     }
 
     if (hostNameForClients != null && !hostNameForClients.equals("")) {
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/adapter/ServiceConfig.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/adapter/ServiceConfig.java
index de56882..8788f34 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/adapter/ServiceConfig.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/adapter/ServiceConfig.java
@@ -66,9 +66,10 @@ public class ServiceConfig implements MembershipConfig {
 
     joinTimeout = Long.getLong("p2p.joinTimeout", defaultJoinTimeout).longValue();
 
+    // if network partition detection is enabled, we must connect to the locators
+    // more frequently in order to make sure we're not isolated from them
     SocketCreator.resolve_dns = true;
-    if (theConfig.getEnableNetworkPartitionDetection() &&
-        !theConfig.getSSLEndPointIdentificationEnabled()) {
+    if (theConfig.getEnableNetworkPartitionDetection()) {
       if (!SocketCreator.FORCE_DNS_USE) {
         SocketCreator.resolve_dns = false;
       }
diff --git a/geode-core/src/main/java/org/apache/geode/internal/DistributionLocator.java b/geode-core/src/main/java/org/apache/geode/internal/DistributionLocator.java
index 8815a6a..731459c 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/DistributionLocator.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/DistributionLocator.java
@@ -18,6 +18,7 @@ package org.apache.geode.internal;
 import java.io.File;
 import java.io.IOException;
 import java.net.InetAddress;
+import java.util.Properties;
 
 import org.apache.logging.log4j.Logger;
 
@@ -25,7 +26,6 @@ import org.apache.geode.SystemFailure;
 import org.apache.geode.annotations.internal.MakeNotStatic;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.distributed.internal.InternalLocator;
-import org.apache.geode.distributed.internal.tcpserver.HostAddress;
 import org.apache.geode.logging.internal.executors.LoggingThread;
 import org.apache.geode.logging.internal.log4j.api.LogService;
 import org.apache.geode.util.internal.GeodeGlossary;
@@ -109,7 +109,9 @@ public class DistributionLocator {
     SystemFailure.loadEmergencyClasses();
 
     final int port = parsePort(args[0]);
-    HostAddress hostAddress = null;
+    InetAddress address = null;
+    boolean peerLocator = true;
+    boolean serverLocator = true;
     String hostnameForClients = null;
     try {
       if (args.length > 1 && !args[1].equals("")) {
@@ -119,37 +121,43 @@ public class DistributionLocator {
                   args[1]));
           ExitCode.FATAL.doSystemExit();
         }
-        hostAddress = new HostAddress(args[1]);
-        // do a look-up to ensure that the name can be resolved to an address
-        InetAddress.getByName(args[1]);
+        address = InetAddress.getByName(args[1]);
       } else {
         // address = null; // was InetAddress.getLocalHost(); (redundant assignment)
       }
+      if (args.length > 2) {
+        peerLocator = "true".equalsIgnoreCase(args[2]);
+      }
+      if (args.length > 3) {
+        serverLocator = "true".equalsIgnoreCase(args[3]);
+      }
       if (args.length > 4) {
         hostnameForClients = args[4];
       }
 
-      final InetAddress inetAddress = hostAddress == null ? null : hostAddress.getAddress();
       if (!Boolean.getBoolean(InternalDistributedSystem.DISABLE_SHUTDOWN_HOOK_PROPERTY)) {
+        final InetAddress faddress = address;
         Runtime.getRuntime()
             .addShutdownHook(new LoggingThread("LocatorShutdownThread", false, () -> {
               try {
-                DistributionLocator.shutdown(port, inetAddress);
+                DistributionLocator.shutdown(port, faddress);
               } catch (IOException e) {
                 e.printStackTrace();
               }
             }));
       }
 
-      lockFile = ManagerInfo.setLocatorStarting(directory, port, inetAddress);
+      lockFile = ManagerInfo.setLocatorStarting(directory, port, address);
       lockFile.deleteOnExit();
 
-      InetAddress address = hostAddress == null ? null : hostAddress.getAddress();
       try {
+
         InternalLocator locator = InternalLocator.startLocator(port, new File(DEFAULT_LOG_FILE),
-            null, null, hostAddress, true, null, hostnameForClients);
+            null, null, address, true, (Properties) null, hostnameForClients);
+
         ManagerInfo.setLocatorStarted(directory, port, address);
         locator.waitToStop();
+
       } finally {
         shutdown(port, address);
       }
@@ -160,7 +168,7 @@ public class DistributionLocator {
 
     } catch (java.net.BindException ex) {
       logger.fatal("Could not bind locator to {}[{}]",
-          new Object[] {hostAddress, port});
+          new Object[] {address, port});
       ExitCode.FATAL.doSystemExit();
 
     } catch (Exception ex) {
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 b5572a8..c4ecb46 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
@@ -26,7 +26,6 @@ import org.apache.commons.lang3.StringUtils;
 import org.apache.geode.InternalGemFireException;
 import org.apache.geode.distributed.Locator;
 import org.apache.geode.distributed.internal.DistributionConfig;
-import org.apache.geode.distributed.internal.InternalLocator;
 import org.apache.geode.distributed.internal.tcpserver.HostAndPort;
 import org.apache.geode.internal.inet.LocalHostUtil;
 import org.apache.geode.internal.net.SSLConfig;
@@ -174,11 +173,7 @@ public class DistributionLocatorId implements java.io.Serializable {
 
   public DistributionLocatorId(InetAddress address, Locator locator) {
     this(address, locator.getPort(),
-        (((InternalLocator) locator).getBindAddressString() != null
-            ? ((InternalLocator) locator).getBindAddressString()
-            : (locator.getBindAddress() != null ? locator.getBindAddress().getHostAddress()
-                : null)),
-        null,
+        locator.getBindAddress() == null ? null : locator.getBindAddress().getHostAddress(), null,
         locator.getHostnameForClients());
   }
 
diff --git a/geode-core/src/main/java/org/apache/geode/internal/net/SocketCreator.java b/geode-core/src/main/java/org/apache/geode/internal/net/SocketCreator.java
index b147a5f..22f2e96 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/net/SocketCreator.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/net/SocketCreator.java
@@ -834,6 +834,17 @@ public class SocketCreator extends TcpSocketCreatorImpl {
     }
 
     String hostName = addr.getHostName();
+    if (this.sslConfig.doEndpointIdentification()
+        && InetAddressValidator.getInstance().isValid(hostName)) {
+      // endpoint validation typically uses a hostname in the sniServer parameter that the handshake
+      // will compare against the subject alternative addresses in the server's certificate. Here
+      // we attempt to get a hostname instead of the proffered numeric address
+      try {
+        hostName = InetAddress.getByName(hostName).getCanonicalHostName();
+      } catch (UnknownHostException e) {
+        // ignore - we'll see what happens with endpoint validation using a numeric address...
+      }
+    }
     serverNames.add(new SNIHostName(hostName));
     modifiedParams.setServerNames(serverNames);
     return true;
diff --git a/geode-core/src/main/java/org/apache/geode/internal/tcp/Connection.java b/geode-core/src/main/java/org/apache/geode/internal/tcp/Connection.java
index 9e0e96e..24b1d7f 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/tcp/Connection.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/tcp/Connection.java
@@ -1725,14 +1725,8 @@ public class Connection implements Runnable {
   private void createIoFilter(SocketChannel channel, boolean clientSocket) throws IOException {
     if (getConduit().useSSL() && channel != null) {
       InetSocketAddress address = (InetSocketAddress) channel.getRemoteAddress();
-      String hostName;
-      if (remoteAddr != null) {
-        hostName = remoteAddr.getHostName();
-      } else {
-        hostName = SocketCreator.getHostName(address.getAddress());
-      }
       SSLEngine engine =
-          getConduit().getSocketCreator().createSSLEngine(hostName,
+          getConduit().getSocketCreator().createSSLEngine(address.getHostString(),
               address.getPort(), clientSocket);
 
       int packetBufferSize = engine.getSession().getPacketBufferSize();
diff --git a/geode-gfsh/src/main/java/org/apache/geode/management/internal/cli/commands/StartLocatorCommand.java b/geode-gfsh/src/main/java/org/apache/geode/management/internal/cli/commands/StartLocatorCommand.java
index 7180a9d..5a98dca 100644
--- a/geode-gfsh/src/main/java/org/apache/geode/management/internal/cli/commands/StartLocatorCommand.java
+++ b/geode-gfsh/src/main/java/org/apache/geode/management/internal/cli/commands/StartLocatorCommand.java
@@ -17,6 +17,7 @@ package org.apache.geode.management.internal.cli.commands;
 
 import java.io.File;
 import java.io.IOException;
+import java.net.InetAddress;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -315,9 +316,9 @@ public class StartLocatorCommand extends OfflineGfshCommand {
 
     infoResult.addLine(locatorState.toString());
     String locatorHostName;
-    String bindAddr = locatorLauncher.getBindAddressString();
+    InetAddress bindAddr = locatorLauncher.getBindAddress();
     if (bindAddr != null) {
-      locatorHostName = bindAddr;
+      locatorHostName = bindAddr.getCanonicalHostName();
     } else {
       locatorHostName = StringUtils.defaultIfBlank(locatorLauncher.getHostnameForClients(),
           HostUtils.getLocalHost());
@@ -482,8 +483,8 @@ public class StartLocatorCommand extends OfflineGfshCommand {
       commandLine.add(launcher.getMemberName());
     }
 
-    if (launcher.getBindAddressString() != null) {
-      commandLine.add("--bind-address=" + launcher.getBindAddressString());
+    if (launcher.getBindAddress() != null) {
+      commandLine.add("--bind-address=" + launcher.getBindAddress().getHostAddress());
     }
 
     if (launcher.isDebugging() || isDebugging()) {
diff --git a/geode-gfsh/src/main/java/org/apache/geode/management/internal/cli/shell/JmxOperationInvoker.java b/geode-gfsh/src/main/java/org/apache/geode/management/internal/cli/shell/JmxOperationInvoker.java
index ee7759b..2433387 100644
--- a/geode-gfsh/src/main/java/org/apache/geode/management/internal/cli/shell/JmxOperationInvoker.java
+++ b/geode-gfsh/src/main/java/org/apache/geode/management/internal/cli/shell/JmxOperationInvoker.java
@@ -130,9 +130,8 @@ public class JmxOperationInvoker implements OperationInvoker {
       env.put("com.sun.jndi.rmi.factory.socket", new ContextAwareSSLRMIClientSocketFactory());
     }
 
-    final String hostName = checkAndConvertToCompatibleIPv6Syntax(host);
     this.url = new JMXServiceURL(MessageFormat.format(JMX_URL_FORMAT,
-        hostName, String.valueOf(port)));
+        checkAndConvertToCompatibleIPv6Syntax(host), String.valueOf(port)));
     this.connector = JMXConnectorFactory.connect(url, env);
     this.mbsc = connector.getMBeanServerConnection();
     this.connector.addConnectionNotificationListener(new JMXConnectionListener(this), null, null);
diff --git a/geode-membership/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/locator/GMSLocatorRecoveryIntegrationTest.java b/geode-membership/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/locator/GMSLocatorRecoveryIntegrationTest.java
index bfe4819..16b09e6 100644
--- a/geode-membership/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/locator/GMSLocatorRecoveryIntegrationTest.java
+++ b/geode-membership/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/locator/GMSLocatorRecoveryIntegrationTest.java
@@ -49,7 +49,6 @@ import org.apache.geode.distributed.internal.membership.gms.MemberIdentifierImpl
 import org.apache.geode.distributed.internal.membership.gms.MembershipLocatorStatisticsNoOp;
 import org.apache.geode.distributed.internal.membership.gms.Services;
 import org.apache.geode.distributed.internal.membership.gms.util.MemberIdentifierUtil;
-import org.apache.geode.distributed.internal.tcpserver.HostAddress;
 import org.apache.geode.distributed.internal.tcpserver.TcpClient;
 import org.apache.geode.distributed.internal.tcpserver.TcpServer;
 import org.apache.geode.distributed.internal.tcpserver.TcpSocketCreatorImpl;
@@ -155,7 +154,7 @@ public class GMSLocatorRecoveryIntegrationTest {
     final TcpSocketCreatorImpl socketCreator = new TcpSocketCreatorImpl();
     locator = MembershipLocatorBuilder.newLocatorBuilder(socketCreator, serializer,
         temporaryFolder.getRoot().toPath(), executorServiceSupplier)
-        .setBindAddress(new HostAddress(localHost)).create();
+        .setBindAddress(localHost).create();
     final int port = locator.start();
 
     try {
@@ -183,7 +182,7 @@ public class GMSLocatorRecoveryIntegrationTest {
 
       // now create a peer location handler that should recover from our real locator and know
       // that real locator's identifier
-      GMSLocator gmsLocator = new GMSLocator(new HostAddress(localHost),
+      GMSLocator gmsLocator = new GMSLocator(localHost,
           membership.getLocalMember().getHost() + "[" + port + "]", true, true,
           new MembershipLocatorStatisticsNoOp(), "", temporaryFolder.getRoot().toPath(),
           locatorClient,
diff --git a/geode-membership/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java b/geode-membership/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java
index 47ec0ff..fd15db6 100644
--- a/geode-membership/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java
+++ b/geode-membership/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java
@@ -1503,7 +1503,7 @@ public class GMSJoinLeaveJUnitTest {
     assertThatThrownBy(gmsJoinLeave::join)
         .isInstanceOf(MembershipConfigurationException.class)
         .hasMessageContaining(
-            "Could not contact any of the locators: [locator1:12345, locator2:54321]")
+            "Could not contact any of the locators: [HostAndPort[locator1:12345], HostAndPort[locator2:54321]]")
         .hasCauseInstanceOf(IOException.class);
   }
 
diff --git a/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/api/MembershipLocatorBuilder.java b/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/api/MembershipLocatorBuilder.java
index 131e1eb..3c7704c 100644
--- a/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/api/MembershipLocatorBuilder.java
+++ b/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/api/MembershipLocatorBuilder.java
@@ -14,13 +14,13 @@
  */
 package org.apache.geode.distributed.internal.membership.api;
 
+import java.net.InetAddress;
 import java.net.UnknownHostException;
 import java.nio.file.Path;
 import java.util.concurrent.ExecutorService;
 import java.util.function.Supplier;
 
 import org.apache.geode.distributed.internal.membership.gms.MembershipLocatorBuilderImpl;
-import org.apache.geode.distributed.internal.tcpserver.HostAddress;
 import org.apache.geode.distributed.internal.tcpserver.ProtocolChecker;
 import org.apache.geode.distributed.internal.tcpserver.TcpHandler;
 import org.apache.geode.distributed.internal.tcpserver.TcpSocketCreator;
@@ -29,7 +29,7 @@ import org.apache.geode.internal.serialization.DSFIDSerializer;
 public interface MembershipLocatorBuilder<ID extends MemberIdentifier> {
   MembershipLocatorBuilder<ID> setPort(int port);
 
-  MembershipLocatorBuilder<ID> setBindAddress(HostAddress bindAddress);
+  MembershipLocatorBuilder<ID> setBindAddress(InetAddress bindAddress);
 
   MembershipLocatorBuilder<ID> setConfig(MembershipConfig membershipConfig);
 
diff --git a/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSMemberData.java b/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSMemberData.java
index 250a640..55aba28 100644
--- a/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSMemberData.java
+++ b/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSMemberData.java
@@ -595,6 +595,8 @@ public class GMSMemberData implements MemberData, Comparable<GMSMemberData> {
 
     this.inetAddr = StaticSerialization.readInetAddress(in);
     if (this.inetAddr != null) {
+      // use address as hostname at this level. getHostName() will do a reverse-dns lookup,
+      // which is very expensive
       this.hostName = inetAddr.getHostAddress();
     }
     this.udpPort = in.readInt();
diff --git a/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/MembershipLocatorBuilderImpl.java b/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/MembershipLocatorBuilderImpl.java
index 98be6b4..4ee8847 100644
--- a/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/MembershipLocatorBuilderImpl.java
+++ b/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/MembershipLocatorBuilderImpl.java
@@ -14,6 +14,7 @@
  */
 package org.apache.geode.distributed.internal.membership.gms;
 
+import java.net.InetAddress;
 import java.net.UnknownHostException;
 import java.nio.file.Path;
 import java.util.concurrent.ExecutorService;
@@ -26,7 +27,6 @@ import org.apache.geode.distributed.internal.membership.api.MembershipLocator;
 import org.apache.geode.distributed.internal.membership.api.MembershipLocatorBuilder;
 import org.apache.geode.distributed.internal.membership.api.MembershipLocatorStatistics;
 import org.apache.geode.distributed.internal.membership.gms.locator.MembershipLocatorImpl;
-import org.apache.geode.distributed.internal.tcpserver.HostAddress;
 import org.apache.geode.distributed.internal.tcpserver.ProtocolChecker;
 import org.apache.geode.distributed.internal.tcpserver.TcpHandler;
 import org.apache.geode.distributed.internal.tcpserver.TcpSocketCreator;
@@ -37,7 +37,7 @@ public final class MembershipLocatorBuilderImpl<ID extends MemberIdentifier> imp
     MembershipLocatorBuilder<ID> {
   private final DSFIDSerializer serializer;
   private int port = 0;
-  private HostAddress bindAddress = null;
+  private InetAddress bindAddress = null;
   private ProtocolChecker protocolChecker = (socket, input, firstByte) -> false;
   private TcpHandler fallbackHandler = new TcpHandlerNoOp();
   private MembershipLocatorStatistics locatorStats = new MembershipLocatorStatisticsNoOp();
@@ -65,7 +65,7 @@ public final class MembershipLocatorBuilderImpl<ID extends MemberIdentifier> imp
   }
 
   @Override
-  public MembershipLocatorBuilder<ID> setBindAddress(HostAddress bindAddress) {
+  public MembershipLocatorBuilder<ID> setBindAddress(InetAddress bindAddress) {
     this.bindAddress = bindAddress;
     return this;
   }
diff --git a/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/locator/GMSLocator.java b/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/locator/GMSLocator.java
index c87fcf8..3cc10eb 100644
--- a/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/locator/GMSLocator.java
+++ b/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/locator/GMSLocator.java
@@ -22,6 +22,7 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
+import java.net.InetAddress;
 import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -44,7 +45,6 @@ import org.apache.geode.distributed.internal.membership.gms.GMSUtil;
 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.messenger.GMSMemberWrapper;
-import org.apache.geode.distributed.internal.tcpserver.HostAddress;
 import org.apache.geode.distributed.internal.tcpserver.HostAndPort;
 import org.apache.geode.distributed.internal.tcpserver.TcpClient;
 import org.apache.geode.distributed.internal.tcpserver.TcpHandler;
@@ -107,7 +107,7 @@ public class GMSLocator<ID extends MemberIdentifier> implements Locator<ID>, Tcp
    * @param objectSerializer a serializer used to persist the membership view
    * @param objectDeserializer a deserializer used to recover the membership view
    */
-  public GMSLocator(HostAddress bindAddress, String locatorString, boolean usePreferredCoordinators,
+  public GMSLocator(InetAddress bindAddress, String locatorString, boolean usePreferredCoordinators,
       boolean networkPartitionDetectionEnabled, MembershipLocatorStatistics locatorStats,
       String securityUDPDHAlgo, Path workingDirectory, final TcpClient locatorClient,
       ObjectSerializer objectSerializer,
@@ -120,8 +120,7 @@ public class GMSLocator<ID extends MemberIdentifier> implements Locator<ID>, Tcp
     if (this.locatorString == null || this.locatorString.isEmpty()) {
       locators = new ArrayList<>(0);
     } else {
-      locators = GMSUtil.parseLocators(locatorString,
-          bindAddress == null ? null : bindAddress.getAddress());
+      locators = GMSUtil.parseLocators(locatorString, bindAddress);
     }
     this.locatorStats = locatorStats;
     this.workingDirectory = workingDirectory;
diff --git a/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/locator/MembershipLocatorImpl.java b/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/locator/MembershipLocatorImpl.java
index 3f86f2a..c4d2333 100644
--- a/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/locator/MembershipLocatorImpl.java
+++ b/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/locator/MembershipLocatorImpl.java
@@ -38,7 +38,6 @@ import org.apache.geode.distributed.internal.membership.api.MembershipLocator;
 import org.apache.geode.distributed.internal.membership.api.MembershipLocatorStatistics;
 import org.apache.geode.distributed.internal.membership.gms.GMSMembership;
 import org.apache.geode.distributed.internal.membership.gms.Services;
-import org.apache.geode.distributed.internal.tcpserver.HostAddress;
 import org.apache.geode.distributed.internal.tcpserver.HostAndPort;
 import org.apache.geode.distributed.internal.tcpserver.ProtocolChecker;
 import org.apache.geode.distributed.internal.tcpserver.TcpClient;
@@ -62,7 +61,7 @@ public class MembershipLocatorImpl<ID extends MemberIdentifier> implements Membe
   private final GMSLocator<ID> gmsLocator;
   private final TcpClient locatorClient;
 
-  public MembershipLocatorImpl(int port, HostAddress bindAddress,
+  public MembershipLocatorImpl(int port, InetAddress bindAddress,
       ProtocolChecker protocolChecker,
       Supplier<ExecutorService> executorServiceSupplier,
       TcpSocketCreator socketCreator,
@@ -76,10 +75,9 @@ public class MembershipLocatorImpl<ID extends MemberIdentifier> implements Membe
     handler = new PrimaryHandler(fallbackHandler, config.getLocatorWaitTime());
     String host = bindAddress == null ? LocalHostUtil.getLocalHostName()
         : bindAddress.getHostName();
-    InetAddress inetAddress = bindAddress == null ? null : bindAddress.getAddress();
     String threadName = "Distribution Locator on " + host + ": " + port;
 
-    this.server = new TcpServer(port, inetAddress, handler,
+    this.server = new TcpServer(port, bindAddress, handler,
         threadName, protocolChecker,
         locatorStats::getStatTime,
         executorServiceSupplier,
@@ -93,7 +91,7 @@ public class MembershipLocatorImpl<ID extends MemberIdentifier> implements Membe
         objectSerializer,
         objectDeserializer, Socket::new);
     gmsLocator =
-        new GMSLocator<ID>(bindAddress, config.getLocators(), locatorsAreCoordinators,
+        new GMSLocator<>(bindAddress, config.getLocators(), locatorsAreCoordinators,
             config.isNetworkPartitionDetectionEnabled(),
             locatorStats, config.getSecurityUDPDHAlgo(), workingDirectory, locatorClient,
             objectSerializer,
diff --git a/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/JGroupsMessenger.java b/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/JGroupsMessenger.java
index 8da3f2f..a695a2d 100644
--- a/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/JGroupsMessenger.java
+++ b/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/JGroupsMessenger.java
@@ -556,10 +556,9 @@ public class JGroupsMessenger<ID extends MemberIdentifier> implements Messenger<
         || !config.getStartLocator().isEmpty();
 
     // establish the DistributedSystem's address
-    String hostname = config.getBindAddress();
-    if (hostname == null || hostname.isEmpty()) {
-      hostname = jgAddress.getInetAddress().getHostName();
-    }
+    String hostname =
+        !config.isNetworkPartitionDetectionEnabled() ? jgAddress.getInetAddress().getHostName()
+            : jgAddress.getInetAddress().getHostAddress();
     GMSMemberData gmsMember = new GMSMemberData(jgAddress.getInetAddress(),
         hostname, jgAddress.getPort(),
         OSProcess.getId(), (byte) services.getConfig().getVmKind(),
diff --git a/geode-tcp-server/src/main/java/org/apache/geode/distributed/internal/tcpserver/HostAddress.java b/geode-tcp-server/src/main/java/org/apache/geode/distributed/internal/tcpserver/HostAddress.java
deleted file mode 100644
index 9f32dfd..0000000
--- a/geode-tcp-server/src/main/java/org/apache/geode/distributed/internal/tcpserver/HostAddress.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * 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.tcpserver;
-
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-
-
-/**
- * HostAddress is a holder of a host name/address. It is the primary
- * way to specify a host address that may or may not be resolvable to an InetAddress.
- * <p>
- * This class preserves the hostName string passed in to its constructor that takes a
- * hostName string and will respond with that string when asked for a hostName.
- *
- * @See HostAndPort which can hold both a host name and a port
- */
-public class HostAddress extends InetSocketWrapper {
-
-  public HostAddress(String hostName) {
-    super(hostName, 0);
-  }
-
-  public HostAddress(InetAddress address) {
-    if (address == null) {
-      throw new IllegalArgumentException("null parameters are not allowed");
-    }
-    inetSocketAddress = new InetSocketAddress(address, 0);
-  }
-
-  public HostAddress(HostAndPort hostAndPort) {
-    hostName = hostAndPort.hostName;
-    inetSocketAddress = hostAndPort.inetSocketAddress;
-  }
-
-  @Override
-  public String toString() {
-    if (hostName != null) {
-      return hostName;
-    } else {
-      return inetSocketAddress.getAddress().toString();
-    }
-  }
-}
diff --git a/geode-tcp-server/src/main/java/org/apache/geode/distributed/internal/tcpserver/HostAndPort.java b/geode-tcp-server/src/main/java/org/apache/geode/distributed/internal/tcpserver/HostAndPort.java
index 73ae775..f7d6805 100644
--- a/geode-tcp-server/src/main/java/org/apache/geode/distributed/internal/tcpserver/HostAndPort.java
+++ b/geode-tcp-server/src/main/java/org/apache/geode/distributed/internal/tcpserver/HostAndPort.java
@@ -19,6 +19,9 @@ import java.io.DataOutput;
 import java.io.IOException;
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
+import java.util.Objects;
+
+import org.apache.commons.validator.routines.InetAddressValidator;
 
 import org.apache.geode.internal.serialization.DataSerializableFixedID;
 import org.apache.geode.internal.serialization.DeserializationContext;
@@ -30,9 +33,6 @@ import org.apache.geode.internal.serialization.Version;
  * HostAndPort is a holder of a host name/address and a port. It is the primary
  * way to specify a connection endpoint in the socket-creator methods.
  * <p>
- * This class preserves the hostName string passed in to its constructor that takes a
- * hostName string and will respond with that string when asked for a hostName.
- * <p>
  * Note: This class is serializable for testing. A number of client/server and WAN tests
  * transmit PoolAttributes between unit test JVMs using RMI. PoolAttributes are
  * Externalizable for this purpose and use Geode serialization to transmit HostAndPort
@@ -43,20 +43,73 @@ import org.apache.geode.internal.serialization.Version;
  * @see ClientSocketCreator
  * @see AdvancedSocketCreator
  * @see TcpClient
- * @see HostAddress
  */
-public class HostAndPort extends InetSocketWrapper implements DataSerializableFixedID {
+public class HostAndPort implements DataSerializableFixedID {
+
+  private InetSocketAddress socketInetAddress;
 
   public HostAndPort() {
     // serialization constructor
   }
 
   public HostAndPort(String hostName, int port) {
-    super(hostName, port);
+    if (hostName == null) {
+      socketInetAddress = new InetSocketAddress(port);
+    } else if (InetAddressValidator.getInstance().isValid(hostName)) {
+      // numeric address - use as-is
+      socketInetAddress = new InetSocketAddress(hostName, port);
+    } else {
+      // non-numeric address - resolve hostname when needed
+      socketInetAddress = InetSocketAddress.createUnresolved(hostName, port);
+    }
+  }
+
+  /**
+   * Returns an InetSocketAddress for this host and port. An attempt is made to resolve the
+   * host name but if resolution fails an unresolved InetSocketAddress is returned. This return
+   * value will not hold an InetAddress, so calling getAddress() on it will return null.
+   */
+  public InetSocketAddress getSocketInetAddress() {
+    if (socketInetAddress.isUnresolved()) {
+      // note that this leaves the InetAddress null if the hostname isn't resolvable
+      return new InetSocketAddress(socketInetAddress.getHostString(), socketInetAddress.getPort());
+    } else {
+      return this.socketInetAddress;
+    }
+  }
+
+  public String getHostName() {
+    return socketInetAddress.getHostString();
   }
 
   public int getPort() {
-    return inetSocketAddress.getPort();
+    return socketInetAddress.getPort();
+  }
+
+  @Override
+  public int hashCode() {
+    return socketInetAddress.hashCode();
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) {
+      return true;
+    }
+    if (o == null || getClass() != o.getClass()) {
+      return false;
+    }
+    HostAndPort that = (HostAndPort) o;
+    return Objects.equals(socketInetAddress, that.socketInetAddress);
+  }
+
+  @Override
+  public String toString() {
+    return getClass().getSimpleName() + "[" + socketInetAddress + "]";
+  }
+
+  public InetAddress getAddress() {
+    return getSocketInetAddress().getAddress();
   }
 
   @Override
@@ -66,13 +119,13 @@ public class HostAndPort extends InetSocketWrapper implements DataSerializableFi
 
   @Override
   public void toData(DataOutput out, SerializationContext context) throws IOException {
-    if (inetSocketAddress.isUnresolved()) {
+    if (socketInetAddress.isUnresolved()) {
       out.writeByte(0);
       StaticSerialization.writeString(getHostName(), out);
       out.writeInt(getPort());
     } else {
       out.writeByte(1);
-      StaticSerialization.writeInetAddress(inetSocketAddress.getAddress(), out);
+      StaticSerialization.writeInetAddress(socketInetAddress.getAddress(), out);
       out.writeInt(getPort());
     }
   }
@@ -80,20 +133,20 @@ public class HostAndPort extends InetSocketWrapper implements DataSerializableFi
   @Override
   public void fromData(DataInput in, DeserializationContext context)
       throws IOException, ClassNotFoundException {
-    InetAddress address;
+    InetAddress address = null;
     byte flags = in.readByte();
     if ((flags & 1) == 0) {
       String hostName = StaticSerialization.readString(in);
       int port = in.readInt();
       if (hostName == null || hostName.isEmpty()) {
-        inetSocketAddress = new InetSocketAddress(port);
+        socketInetAddress = new InetSocketAddress(port);
       } else {
-        inetSocketAddress = InetSocketAddress.createUnresolved(hostName, port);
+        socketInetAddress = InetSocketAddress.createUnresolved(hostName, port);
       }
     } else {
       address = StaticSerialization.readInetAddress(in);
       int port = in.readInt();
-      inetSocketAddress = new InetSocketAddress(address, port);
+      socketInetAddress = new InetSocketAddress(address, port);
     }
   }
 
@@ -101,4 +154,6 @@ public class HostAndPort extends InetSocketWrapper implements DataSerializableFi
   public Version[] getSerializationVersions() {
     return null;
   }
+
+
 }
diff --git a/geode-tcp-server/src/main/java/org/apache/geode/distributed/internal/tcpserver/InetSocketWrapper.java b/geode-tcp-server/src/main/java/org/apache/geode/distributed/internal/tcpserver/InetSocketWrapper.java
deleted file mode 100644
index 168fc3f..0000000
--- a/geode-tcp-server/src/main/java/org/apache/geode/distributed/internal/tcpserver/InetSocketWrapper.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * 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.tcpserver;
-
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.util.Objects;
-
-import org.apache.commons.validator.routines.InetAddressValidator;
-
-class InetSocketWrapper {
-  String hostName;
-  protected InetSocketAddress inetSocketAddress;
-  private InetSocketAddress attemptedToResolve;
-
-  protected InetSocketWrapper() {}
-
-  protected InetSocketWrapper(String hostName, int port) {
-    // preserve the hostName string since InetSocketAddress will throw it away if it's a numeric
-    // address. Invoking getHostName on the InetSocketAddress would possibly return a different
-    // string.
-    this.hostName = hostName;
-    if (hostName == null) {
-      inetSocketAddress = new InetSocketAddress(port);
-    } else if (InetAddressValidator.getInstance().isValid(hostName)) {
-      // numeric address - use as-is
-      inetSocketAddress = new InetSocketAddress(hostName, port);
-    } else {
-      // non-numeric address - resolve hostname when needed
-      inetSocketAddress = InetSocketAddress.createUnresolved(hostName, port);
-    }
-  }
-
-  public String getHostName() {
-    if (hostName != null) {
-      return hostName;
-    }
-    return inetSocketAddress.getHostName();
-  }
-
-  public InetAddress getAddress() {
-    return getSocketInetAddress().getAddress();
-  }
-
-  @Override
-  public int hashCode() {
-    return inetSocketAddress.hashCode();
-  }
-
-  @Override
-  public boolean equals(Object o) {
-    if (this == o) {
-      return true;
-    }
-    if (o == null || getClass() != o.getClass()) {
-      return false;
-    }
-    InetSocketWrapper that = (InetSocketWrapper) o;
-    return Objects.equals(inetSocketAddress, that.inetSocketAddress);
-  }
-
-  /**
-   * Returns an InetSocketAddress for this host and port. An attempt is made to resolve the
-   * host name but if resolution fails an unresolved InetSocketAddress is returned. This return
-   * value will not hold an InetAddress, so calling getAddress() on it will return null.
-   */
-  public InetSocketAddress getSocketInetAddress() {
-    if (attemptedToResolve == null) {
-      attemptedToResolve = basicGetInetSocketAddress();
-    }
-    return attemptedToResolve;
-  }
-
-  private InetSocketAddress basicGetInetSocketAddress() {
-    if (inetSocketAddress.isUnresolved()) {
-      // note that this leaves the InetAddress null if the hostname isn't resolvable
-      return new InetSocketAddress(inetSocketAddress.getHostString(), inetSocketAddress.getPort());
-    } else {
-      return inetSocketAddress;
-    }
-  }
-
-  @Override
-  public String toString() {
-    return inetSocketAddress.toString();
-  }
-
-}
diff --git a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/WANTestBase.java b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/WANTestBase.java
index 655926b..ab6933a 100644
--- a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/WANTestBase.java
+++ b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/WANTestBase.java
@@ -52,6 +52,7 @@ import static org.junit.Assert.fail;
 import java.io.File;
 import java.io.IOException;
 import java.io.Serializable;
+import java.net.InetAddress;
 import java.net.InetSocketAddress;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -380,7 +381,7 @@ public class WANTestBase extends DistributedTestCase {
     props.setProperty(DISTRIBUTED_SYSTEM_ID, "" + dsId);
     props.setProperty(LOCATORS, "localhost[" + localPort + "]");
     props.setProperty(REMOTE_LOCATORS, "localhost[" + remoteLocPort + "]");
-    Locator locator = Locator.startLocatorAndDS(0, null, null, props,
+    Locator locator = Locator.startLocatorAndDS(0, null, InetAddress.getByName("0.0.0.0"), props,
         true, true, hostnameForClients);
     return locator.getPort();
   }

[geode] 03/05: Revert "spA changes"

Posted by ec...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

echobravo pushed a commit to branch revert/1.13
in repository https://gitbox.apache.org/repos/asf/geode.git

commit c4ebf586c94d41b655ee4ad02d53458db48a3339
Author: Ernest Burghardt <eb...@pivotal.io>
AuthorDate: Tue Jun 22 13:49:38 2021 -0500

    Revert "spA changes"
    
    This reverts commit 844f2a75cacfce0b42f42a37a12819612f00b3e5.
---
 .../geode/cache30/ReconnectWithClusterConfigurationDUnitTest.java | 8 +-------
 .../InternalLocatorClusterManagementServiceIntegrationTest.java   | 1 -
 .../distributed/internal/InternalLocatorIntegrationTest.java      | 4 +++-
 .../main/java/org/apache/geode/internal/net/SocketCreator.java    | 1 +
 4 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithClusterConfigurationDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithClusterConfigurationDUnitTest.java
index d6925d1..b67bc55 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithClusterConfigurationDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithClusterConfigurationDUnitTest.java
@@ -31,7 +31,6 @@ import static org.assertj.core.api.Assertions.assertThat;
 import java.io.File;
 import java.io.IOException;
 import java.io.Serializable;
-import java.nio.file.Paths;
 import java.util.List;
 import java.util.Properties;
 import java.util.concurrent.TimeUnit;
@@ -40,7 +39,6 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
 
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheFactory;
@@ -52,7 +50,6 @@ import org.apache.geode.distributed.internal.membership.api.MembershipManagerHel
 import org.apache.geode.distributed.internal.tcpserver.HostAddress;
 import org.apache.geode.internal.AvailablePort;
 import org.apache.geode.internal.AvailablePortHelper;
-import org.apache.geode.internal.inet.LocalHostUtil;
 import org.apache.geode.test.awaitility.GeodeAwaitility;
 import org.apache.geode.test.dunit.Assert;
 import org.apache.geode.test.dunit.AsyncInvocation;
@@ -73,11 +70,9 @@ public class ReconnectWithClusterConfigurationDUnitTest implements Serializable
 
   @Rule
   public DistributedRule distributedRule = DistributedRule.builder().withVMCount(NUM_VMS).build();
-  @Rule
-  public transient TemporaryFolder temporaryFolder = new TemporaryFolder();
 
   @Before
-  public void setup() throws IOException {
+  public void setup() {
     List<AvailablePort.Keeper> randomAvailableTCPPortKeepers =
         AvailablePortHelper.getRandomAvailableTCPPortKeepers(NUM_LOCATORS);
     for (int i = 0; i < NUM_LOCATORS; i++) {
@@ -87,7 +82,6 @@ public class ReconnectWithClusterConfigurationDUnitTest implements Serializable
     final int[] locPorts = locatorPorts;
     Invoke.invokeInEveryVM("set locator ports", () -> locatorPorts = locPorts);
     for (int i = 0; i < NUM_LOCATORS; i++) {
-      final String workingDir = temporaryFolder.newFolder().getAbsolutePath();
       final int locatorNumber = i;
       randomAvailableTCPPortKeepers.get(locatorNumber).release();
       VM.getVM(i).invoke("start locator", () -> {
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/InternalLocatorClusterManagementServiceIntegrationTest.java b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/InternalLocatorClusterManagementServiceIntegrationTest.java
index 58598c0..e4b67af 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/InternalLocatorClusterManagementServiceIntegrationTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/InternalLocatorClusterManagementServiceIntegrationTest.java
@@ -28,7 +28,6 @@ import java.net.URISyntaxException;
 import java.util.Optional;
 
 import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 
 import org.apache.geode.cache.RegionShortcut;
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/InternalLocatorIntegrationTest.java b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/InternalLocatorIntegrationTest.java
index f5041d4..0f3de29 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/InternalLocatorIntegrationTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/InternalLocatorIntegrationTest.java
@@ -21,6 +21,8 @@ import static org.mockito.Mockito.when;
 
 import java.io.File;
 import java.io.IOException;
+import java.net.InetAddress;
+import java.nio.charset.Charset;
 import java.nio.file.Path;
 import java.util.Properties;
 
@@ -36,8 +38,8 @@ import org.mockito.junit.MockitoRule;
 import org.mockito.quality.Strictness;
 
 import org.apache.geode.distributed.Locator;
-import org.apache.geode.distributed.internal.tcpserver.HostAddress;
 import org.apache.geode.internal.logging.InternalLogWriter;
+import org.apache.geode.distributed.internal.tcpserver.HostAddress;
 import org.apache.geode.internal.security.SecurableCommunicationChannel;
 import org.apache.geode.logging.internal.LoggingSession;
 
diff --git a/geode-core/src/main/java/org/apache/geode/internal/net/SocketCreator.java b/geode-core/src/main/java/org/apache/geode/internal/net/SocketCreator.java
index 4ac863b..b147a5f 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/net/SocketCreator.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/net/SocketCreator.java
@@ -62,6 +62,7 @@ import javax.net.ssl.TrustManagerFactory;
 import javax.net.ssl.X509ExtendedKeyManager;
 
 import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.validator.routines.InetAddressValidator;
 import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.GemFireConfigException;

[geode] 05/05: Revert "GEODE-7861: Improve error reporting in GMSJoinLeave.join() (#5839)"

Posted by ec...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

echobravo pushed a commit to branch revert/1.13
in repository https://gitbox.apache.org/repos/asf/geode.git

commit 2249dd163948be472b72dd0d0204b6a5952fc181
Author: Ernest Burghardt <eb...@pivotal.io>
AuthorDate: Tue Jun 22 13:50:05 2021 -0500

    Revert "GEODE-7861: Improve error reporting in GMSJoinLeave.join() (#5839)"
    
    This reverts commit 53d32c325c808d6e965a45cdf36aca1a71db2183.
---
 .../apache/geode/distributed/LocatorDUnitTest.java |   3 +-
 .../gms/membership/GMSJoinLeaveJUnitTest.java      | 100 +++++----------------
 .../internal/membership/gms/GMSMembership.java     |   7 +-
 .../membership/gms/interfaces/JoinLeave.java       |  12 +--
 .../membership/gms/membership/GMSJoinLeave.java    |  76 ++++++----------
 5 files changed, 55 insertions(+), 143 deletions(-)

diff --git a/geode-core/src/distributedTest/java/org/apache/geode/distributed/LocatorDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/distributed/LocatorDUnitTest.java
index e0f8966..d3c1733 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/distributed/LocatorDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/distributed/LocatorDUnitTest.java
@@ -1002,8 +1002,7 @@ public class LocatorDUnitTest implements Serializable {
 
     } catch (GemFireConfigException ex) {
       String s = ex.getMessage();
-      assertThat(s.contains("Could not contact any of the locators"))
-          .isTrue();
+      assertThat(s.contains("Locator does not exist")).isTrue();
     }
   }
 
diff --git a/geode-membership/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java b/geode-membership/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java
index fd15db6..3a86a1e 100644
--- a/geode-membership/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java
+++ b/geode-membership/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java
@@ -22,14 +22,12 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
-import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.anyBoolean;
 import static org.mockito.ArgumentMatchers.anyInt;
 import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Matchers.isA;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.timeout;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
@@ -117,18 +115,11 @@ public class GMSJoinLeaveJUnitTest {
 
   public void initMocks(boolean enableNetworkPartition, boolean useTestGMSJoinLeave)
       throws Exception {
-    String locator = "localhost[12345]";
-    initMocks(enableNetworkPartition, useTestGMSJoinLeave, locator, locator);
-  }
-
-  public void initMocks(boolean enableNetworkPartition, boolean useTestGMSJoinLeave,
-      String locators, String startLocator)
-      throws Exception {
     mockConfig = mock(MembershipConfig.class);
     when(mockConfig.isNetworkPartitionDetectionEnabled()).thenReturn(enableNetworkPartition);
     when(mockConfig.getSecurityUDPDHAlgo()).thenReturn("");
-    when(mockConfig.getStartLocator()).thenReturn(startLocator);
-    when(mockConfig.getLocators()).thenReturn(locators);
+    when(mockConfig.getStartLocator()).thenReturn("localhost[12345]");
+    when(mockConfig.getLocators()).thenReturn("localhost[12345]");
     when(mockConfig.getMcastPort()).thenReturn(0);
     when(mockConfig.getMemberTimeout()).thenReturn(2000L);
 
@@ -1432,7 +1423,14 @@ public class GMSJoinLeaveJUnitTest {
   @Test
   public void testCoordinatorFindRequestSuccess() throws Exception {
     initMocks(false);
-    mockRequestToServer(isA(HostAndPort.class));
+    HashSet<MemberIdentifier> registrants = new HashSet<>();
+    registrants.add(mockMembers[0]);
+    FindCoordinatorResponse fcr = new FindCoordinatorResponse(mockMembers[0], mockMembers[0], false,
+        null, registrants, false, true, null);
+
+    when(locatorClient.requestToServer(isA(HostAndPort.class),
+        isA(FindCoordinatorRequest.class), anyInt(), anyBoolean()))
+            .thenReturn(fcr);
 
     boolean foundCoordinator = gmsJoinLeave.findCoordinator();
     assertTrue(gmsJoinLeave.searchState.toString(), foundCoordinator);
@@ -1443,80 +1441,22 @@ public class GMSJoinLeaveJUnitTest {
   public void testCoordinatorFindRequestFailure() throws Exception {
     try {
       initMocks(false);
-      mockRequestToServer(eq(new HostAndPort("localhost", 12346)));
+      HashSet<MemberIdentifier> registrants = new HashSet<>();
+      registrants.add(mockMembers[0]);
+      FindCoordinatorResponse fcr = new FindCoordinatorResponse(mockMembers[0], mockMembers[0],
+          false, null, registrants, false, true, null);
       GMSMembershipView view = createView();
       JoinResponseMessage jrm = new JoinResponseMessage(mockMembers[0], view, 0);
       gmsJoinLeave.setJoinResponseMessage(jrm);
 
-      assertThatThrownBy(gmsJoinLeave::join)
-          .isInstanceOf(MembershipConfigurationException.class);
-    } finally {
-    }
-  }
-
-  @Test
-  public void testJoinFailureWhenSleepInterrupted() throws Exception {
-    initMocks(false);
-    mockRequestToServer(isA(HostAndPort.class));
-
-    when(mockConfig.getMemberTimeout()).thenReturn(100L);
-    when(mockConfig.getJoinTimeout()).thenReturn(1000L);
-
-    GMSJoinLeave spyGmsJoinLeave = spy(gmsJoinLeave);
-    when(spyGmsJoinLeave.pauseIfThereIsNoCoordinator(-1, GMSJoinLeave.JOIN_RETRY_SLEEP))
-        .thenThrow(new InterruptedException());
-
-    assertThatThrownBy(spyGmsJoinLeave::join)
-        .isInstanceOf(MembershipConfigurationException.class)
-        .hasMessageContaining("Retry sleep interrupted");
-  }
-
-  @Test
-  public void testJoinFailureWhenTimeout() throws Exception {
-    initMocks(false);
-    mockRequestToServer(isA(HostAndPort.class));
-
-    assertThatThrownBy(() -> gmsJoinLeave.join())
-        .isInstanceOf(MembershipConfigurationException.class)
-        .hasMessageContaining("Operation timed out");
-  }
-
-  @Test
-  public void testPauseIfThereIsNoCoordinator() throws InterruptedException {
-    locatorClient = mock(TcpClient.class);
-    gmsJoinLeave = new GMSJoinLeave(locatorClient);
-    assertThat(gmsJoinLeave.pauseIfThereIsNoCoordinator(-1, GMSJoinLeave.JOIN_RETRY_SLEEP))
-        .isFalse();
-    assertThat(gmsJoinLeave.pauseIfThereIsNoCoordinator(1, GMSJoinLeave.JOIN_RETRY_SLEEP)).isTrue();
-  }
-
-  @Test
-  public void testJoinFailureWhenNoLocator() throws Exception {
-    final String locator1 = "locator1[12345]";
-    final String locator2 = "locator2[54321]";
-    locatorClient = mock(TcpClient.class);
+      when(locatorClient.requestToServer(eq(new HostAndPort("localhost", 12346)),
+          isA(FindCoordinatorRequest.class), anyInt(), anyBoolean()))
+              .thenReturn(fcr);
 
-    initMocks(false, false, locator1 + ',' + locator2, locator1);
-    when(locatorClient.requestToServer(any(), any(), anyInt(), anyBoolean()))
-        .thenThrow(IOException.class);
-
-    assertThatThrownBy(gmsJoinLeave::join)
-        .isInstanceOf(MembershipConfigurationException.class)
-        .hasMessageContaining(
-            "Could not contact any of the locators: [HostAndPort[locator1:12345], HostAndPort[locator2:54321]]")
-        .hasCauseInstanceOf(IOException.class);
-  }
-
-  private void mockRequestToServer(HostAndPort hostAndPort)
-      throws IOException, ClassNotFoundException {
-    HashSet<MemberIdentifier> registrants = new HashSet<>();
-    registrants.add(mockMembers[0]);
+      assertFalse("Should not be able to join ", gmsJoinLeave.join());
+    } finally {
 
-    FindCoordinatorResponse fcr = new FindCoordinatorResponse(mockMembers[0], mockMembers[0], false,
-        null, registrants, false, true, null);
-    when(locatorClient.requestToServer(hostAndPort,
-        isA(FindCoordinatorRequest.class), anyInt(), anyBoolean()))
-            .thenReturn(fcr);
+    }
   }
 
   private void waitForViewAndFinalCheckInProgress(int viewId) throws InterruptedException {
diff --git a/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSMembership.java b/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSMembership.java
index 2d88312..e1d1b55 100644
--- a/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSMembership.java
+++ b/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSMembership.java
@@ -571,7 +571,12 @@ public class GMSMembership<ID extends MemberIdentifier> implements Membership<ID
         this.isJoining = true; // added for bug #44373
 
         // connect
-        services.getJoinLeave().join();
+        boolean ok = services.getJoinLeave().join();
+
+        if (!ok) {
+          throw new MembershipConfigurationException("Unable to join the distributed system.  "
+              + "Operation either timed out, was stopped or Locator does not exist.");
+        }
 
         MembershipView<ID> initialView = createGeodeView(services.getJoinLeave().getView());
         latestView = new MembershipView<>(initialView, initialView.getViewId());
diff --git a/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/JoinLeave.java b/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/JoinLeave.java
index 1880a26..7228162 100755
--- a/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/JoinLeave.java
+++ b/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/JoinLeave.java
@@ -16,7 +16,6 @@ package org.apache.geode.distributed.internal.membership.gms.interfaces;
 
 import org.apache.geode.distributed.internal.membership.api.MemberIdentifier;
 import org.apache.geode.distributed.internal.membership.api.MemberStartupException;
-import org.apache.geode.distributed.internal.membership.api.MembershipConfigurationException;
 import org.apache.geode.distributed.internal.membership.gms.GMSMembershipView;
 
 /**
@@ -27,15 +26,10 @@ import org.apache.geode.distributed.internal.membership.gms.GMSMembershipView;
 public interface JoinLeave<ID extends MemberIdentifier> extends Service<ID> {
 
   /**
-   * joins the distributed system.
-   *
-   * @throws MemberStartupException if there was a problem joining the cluster after membership
-   *         configuration has
-   *         completed.
-   * @throws MembershipConfigurationException if operation either timed out, was stopped or locator
-   *         does not exist.
+   * joins the distributed system and returns true if successful, false if not. Throws
+   * MemberStartupException and MemberConfigurationException
    */
-  void join() throws MemberStartupException;
+  boolean join() throws MemberStartupException;
 
   /**
    * leaves the distributed system. Should be invoked before stop()
diff --git a/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java b/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java
index 7328ae3..ff5c619 100644
--- a/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java
+++ b/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java
@@ -273,13 +273,11 @@ public class GMSJoinLeave<ID extends MemberIdentifier> implements JoinLeave<ID>
     int lastFindCoordinatorInViewId = -1000;
     final Set<FindCoordinatorResponse<ID>> responses = new HashSet<>();
     public int responsesExpected;
-    Exception lastLocatorException;
 
     void cleanup() {
       alreadyTried.clear();
       possibleCoordinator = null;
       view = null;
-      lastLocatorException = null;
       synchronized (responses) {
         responses.clear();
       }
@@ -317,14 +315,14 @@ public class GMSJoinLeave<ID extends MemberIdentifier> implements JoinLeave<ID>
    * @return true if successful, false if not
    */
   @Override
-  public void join() throws MemberStartupException {
+  public boolean join() throws MemberStartupException {
 
     try {
       if (Boolean.getBoolean(BYPASS_DISCOVERY_PROPERTY)) {
         synchronized (viewInstallationLock) {
           becomeCoordinator();
         }
-        return;
+        return true;
       }
 
       SearchState<ID> state = searchState;
@@ -357,11 +355,11 @@ public class GMSJoinLeave<ID extends MemberIdentifier> implements JoinLeave<ID>
               synchronized (viewInstallationLock) {
                 becomeCoordinator();
               }
-              return;
+              return true;
             }
           } else {
             if (attemptToJoin()) {
-              return;
+              return true;
             }
             if (this.isStopping) {
               break;
@@ -385,45 +383,40 @@ public class GMSJoinLeave<ID extends MemberIdentifier> implements JoinLeave<ID>
             break;
           }
         }
-        if (found && !state.hasContactedAJoinedLocator) {
-          try {
-            if (pauseIfThereIsNoCoordinator(state.possibleCoordinator.getVmViewId(), retrySleep)) {
+        try {
+          if (found && !state.hasContactedAJoinedLocator) {
+            // if locators are restarting they may be handing out IDs from a stale view that
+            // we should go through quickly. Otherwise we should sleep a bit to let failure
+            // detection select a new coordinator
+            if (state.possibleCoordinator.getVmViewId() < 0) {
+              logger.debug("sleeping for {} before making another attempt to find the coordinator",
+                  retrySleep);
+              Thread.sleep(retrySleep);
+            } else {
               // since we were given a coordinator that couldn't be used we should keep trying
               tries = 0;
               giveupTime = System.currentTimeMillis() + timeout;
             }
-          } catch (InterruptedException e) {
-            Thread.currentThread().interrupt();
-            throw new MembershipConfigurationException(
-                "Retry sleep interrupted. Giving up on joining the distributed system.");
           }
+        } catch (InterruptedException e) {
+          logger.debug("retry sleep interrupted - giving up on joining the distributed system");
+          return false;
         }
       } // for
 
       if (!this.isJoined) {
         logger.debug("giving up attempting to join the distributed system after "
             + (System.currentTimeMillis() - startTime) + "ms");
+      }
 
-        // to preserve old behavior we need to throw a MemberStartupException if
-        // unable to contact any of the locators
-        if (state.hasContactedAJoinedLocator) {
-          throw new MemberStartupException("Unable to join the distributed system in "
-              + (System.currentTimeMillis() - startTime) + "ms");
-        }
-
-        if (state.locatorsContacted == 0) {
-          throw new MembershipConfigurationException(
-              "Unable to join the distributed system. Could not contact any of the locators: "
-                  + locators,
-              state.lastLocatorException);
-        }
-
-        if (System.currentTimeMillis() > giveupTime) {
-          throw new MembershipConfigurationException(
-              "Unable to join the distributed system. Operation timed out");
-        }
+      // to preserve old behavior we need to throw a MemberStartupException if
+      // unable to contact any of the locators
+      if (!this.isJoined && state.hasContactedAJoinedLocator) {
+        throw new MemberStartupException("Unable to join the distributed system in "
+            + (System.currentTimeMillis() - startTime) + "ms");
       }
-      return;
+
+      return this.isJoined;
     } finally {
       // notify anyone waiting on the address to be completed
       if (this.isJoined) {
@@ -435,24 +428,6 @@ public class GMSJoinLeave<ID extends MemberIdentifier> implements JoinLeave<ID>
     }
   }
 
-  boolean pauseIfThereIsNoCoordinator(int viewId, long retrySleep)
-      throws InterruptedException {
-    // if locators are restarting they may be handing out IDs from a stale view that
-    // we should go through quickly. Otherwise we should sleep a bit to let failure
-    // detection select a new coordinator
-    if (viewId < 0) {
-      // the process hasn't finished joining the cluster.
-      logger.debug("sleeping for {} before making another attempt to find the coordinator",
-          retrySleep);
-      Thread.sleep(retrySleep);
-    } else {
-      // the member has joined the cluster.
-      return true;
-    }
-
-    return false;
-  }
-
   /**
    * send a join request and wait for a reply. Process the reply. This may throw a
    * MemberStartupException or an exception from the authenticator, if present.
@@ -1224,7 +1199,6 @@ public class GMSJoinLeave<ID extends MemberIdentifier> implements JoinLeave<ID>
         } catch (IOException | ClassNotFoundException problem) {
           logger.info("Unable to contact locator " + laddr + ": " + problem);
           logger.debug("Exception thrown when contacting a locator", problem);
-          state.lastLocatorException = problem;
           if (state.locatorsContacted == 0 && System.currentTimeMillis() < giveUpTime) {
             try {
               Thread.sleep(FIND_LOCATOR_RETRY_SLEEP);

[geode] 01/05: Revert "clean up"

Posted by ec...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

echobravo pushed a commit to branch revert/1.13
in repository https://gitbox.apache.org/repos/asf/geode.git

commit eafe320a430827b34c0a6cf4d5e099a15c84fbec
Author: Ernest Burghardt <eb...@pivotal.io>
AuthorDate: Tue Jun 22 13:49:13 2021 -0500

    Revert "clean up"
    
    This reverts commit 35cbee2c00cf3bf0119b09369631c9f61e293217.
---
 .../geode/cache30/ReconnectWithClusterConfigurationDUnitTest.java       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithClusterConfigurationDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithClusterConfigurationDUnitTest.java
index 8288ac2..32edbc5 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithClusterConfigurationDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithClusterConfigurationDUnitTest.java
@@ -98,7 +98,7 @@ public class ReconnectWithClusterConfigurationDUnitTest implements Serializable
           dsProperties = null;
           Properties props = getDistributedSystemProperties();
           locator = InternalLocator.startLocator(locatorPorts[locatorNumber], new File(""),
-              null, null, new HostAddress(LocalHostUtil.getLocalHost()), true,
+              null, null, LocalHostUtil.getLocalHost(), true,
               props, null, Paths.get(workingDir));
           system = locator.getDistributedSystem();
           cache = ((InternalLocator) locator).getCache();

[geode] 02/05: Revert "GEODE-8206: CI Failure: ReconnectWithClusterConfigurationDUnitTest.testReconnectAfterMeltdown hang (#5192)"

Posted by ec...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

echobravo pushed a commit to branch revert/1.13
in repository https://gitbox.apache.org/repos/asf/geode.git

commit 18af49fe3e9f16bd3339c251217123ea5235a1bf
Author: Ernest Burghardt <eb...@pivotal.io>
AuthorDate: Tue Jun 22 13:49:25 2021 -0500

    Revert "GEODE-8206: CI Failure: ReconnectWithClusterConfigurationDUnitTest.testReconnectAfterMeltdown hang (#5192)"
    
    This reverts commit aba29fb7dd236ecd8f784672c50236d7983332a0.
---
 ...ReconnectWithClusterConfigurationDUnitTest.java | 23 +++++++++++-----------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithClusterConfigurationDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithClusterConfigurationDUnitTest.java
index 32edbc5..d6925d1 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithClusterConfigurationDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithClusterConfigurationDUnitTest.java
@@ -31,7 +31,6 @@ import static org.assertj.core.api.Assertions.assertThat;
 import java.io.File;
 import java.io.IOException;
 import java.io.Serializable;
-import java.net.UnknownHostException;
 import java.nio.file.Paths;
 import java.util.List;
 import java.util.Properties;
@@ -47,6 +46,7 @@ import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.distributed.DistributedSystem;
 import org.apache.geode.distributed.Locator;
+import org.apache.geode.distributed.internal.InternalConfigurationPersistenceService;
 import org.apache.geode.distributed.internal.InternalLocator;
 import org.apache.geode.distributed.internal.membership.api.MembershipManagerHelper;
 import org.apache.geode.distributed.internal.tcpserver.HostAddress;
@@ -72,9 +72,7 @@ public class ReconnectWithClusterConfigurationDUnitTest implements Serializable
   static Properties dsProperties;
 
   @Rule
-  public transient DistributedRule distributedRule =
-      DistributedRule.builder().withVMCount(NUM_VMS).build();
-
+  public DistributedRule distributedRule = DistributedRule.builder().withVMCount(NUM_VMS).build();
   @Rule
   public transient TemporaryFolder temporaryFolder = new TemporaryFolder();
 
@@ -98,7 +96,7 @@ public class ReconnectWithClusterConfigurationDUnitTest implements Serializable
           dsProperties = null;
           Properties props = getDistributedSystemProperties();
           locator = InternalLocator.startLocator(locatorPorts[locatorNumber], new File(""),
-              null, null, LocalHostUtil.getLocalHost(), true,
+              null, null, new HostAddress(LocalHostUtil.getLocalHost()), true,
               props, null, Paths.get(workingDir));
           system = locator.getDistributedSystem();
           cache = ((InternalLocator) locator).getCache();
@@ -117,8 +115,10 @@ public class ReconnectWithClusterConfigurationDUnitTest implements Serializable
       VM.getVM(i).invoke(() -> {
         InternalLocator locator = InternalLocator.getLocator();
         if (locator != null) {
-          if (cache != null && cache.isReconnecting()) {
-            cache.stopReconnecting();
+          InternalConfigurationPersistenceService sharedConfig =
+              locator.getConfigurationPersistenceService();
+          if (sharedConfig != null) {
+            sharedConfig.destroySharedConfiguration();
           }
           locator.stop();
         }
@@ -133,7 +133,7 @@ public class ReconnectWithClusterConfigurationDUnitTest implements Serializable
     });
   }
 
-  public Properties getDistributedSystemProperties() throws UnknownHostException {
+  public Properties getDistributedSystemProperties() {
     dsProperties = new Properties();
     dsProperties.put(MAX_WAIT_TIME_RECONNECT, "" + (5000 * NUM_VMS));
     dsProperties.put(ENABLE_NETWORK_PARTITION_DETECTION, "true");
@@ -142,13 +142,12 @@ public class ReconnectWithClusterConfigurationDUnitTest implements Serializable
     dsProperties.put(USE_CLUSTER_CONFIGURATION, "true");
     dsProperties.put(HTTP_SERVICE_PORT, "0");
     StringBuilder stringBuilder = new StringBuilder();
-    final String localHostName = LocalHostUtil.getLocalHostName();
-    stringBuilder.append(localHostName + "[")
+    stringBuilder.append("localHost[")
         .append(locatorPorts[0])
         .append(']');
     for (int i = 1; i < NUM_LOCATORS; i++) {
-      stringBuilder.append("," + localHostName + "[")
-          .append(locatorPorts[i])
+      stringBuilder.append(",localHost[")
+          .append(locatorPorts[0])
           .append(']');
     }
     dsProperties.put(LOCATORS, stringBuilder.toString());