pivotal-jbarrett commented on a change in pull request #5680:
URL: https://github.com/apache/geode/pull/5680#discussion_r521719226



##########
File path: 
geode-common/src/main/java/org/apache/geode/internal/inet/LocalHostUtil.java
##########
@@ -54,70 +59,80 @@
   private static final boolean useLinkLocalAddresses =
       Boolean.getBoolean(USE_LINK_LOCAL_ADDRESSES_PROPERTY);
 
-  /**
-   * we cache localHost to avoid bug #40619, access-violation in native code
-   */
-  private static final InetAddress localHost;
-
   /**
    * all classes should use this variable to determine whether to use IPv4 or 
IPv6 addresses
    */
   @MakeNotStatic
   private static boolean useIPv6Addresses = 
!Boolean.getBoolean("java.net.preferIPv4Stack")
       && Boolean.getBoolean("java.net.preferIPv6Addresses");
 
-  static {
-    InetAddress inetAddress = null;
+  /**
+   * Resolves local host. Will retry if resolution fails.
+   *
+   * @return local host if resolved otherwise null.
+   */
+  private static InetAddress resolveLocalHost() {

Review comment:
       There is a test that already asserts the retry behavior outside the 
context of the thing being retried. Testing this method specifically must be an 
integration test since it requires the use of a resolver and DNS. There are 
several tests that are tangentially dependent on this method given that nothing 
in Geode starts if this method returns `UnknownHostException`.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to