Bill commented on a change in pull request #5743:
URL: https://github.com/apache/geode/pull/5743#discussion_r523291215



##########
File path: 
geode-common/src/main/java/org/apache/geode/internal/inet/LocalHostUtil.java
##########
@@ -54,19 +59,27 @@
   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 {
+  /**
+   * Resolves local host. Will retry if resolution fails.
+   *
+   * @return local host if resolved otherwise null.
+   */
+  private static InetAddress tryToResolveLocalHost() {
+    try {
+      return tryFor(60, SECONDS, 1, SECONDS, LocalHostUtil::resolveLocalHost, 
Objects::nonNull);

Review comment:
       so cool!




----------------------------------------------------------------
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