adityamukho commented on code in PR #7188:
URL: https://github.com/apache/ignite-3/pull/7188#discussion_r2602089612


##########
modules/network/src/main/java/org/apache/ignite/internal/network/StaticNodeFinder.java:
##########
@@ -70,14 +84,33 @@ public void start() {
     }
 
     private static String[] resolveAll(String host) {
-        InetAddress[] inetAddresses;
-        try {
-            inetAddresses = InetAddress.getAllByName(host);
-        } catch (UnknownHostException e) {
-            LOG.warn("Cannot resolve {}", host);
-            return ArrayUtils.STRING_EMPTY_ARRAY;
-        }
+        InetAddress[] inetAddresses = null;
+
+        final int maxTries = 3;
+        int tryCount = 0;
+        boolean resolved = false;
+
+        do {
+            tryCount++;
+
+            try {
+                inetAddresses = InetAddress.getAllByName(host);
+                resolved = true;
+            } catch (UnknownHostException e) {
+                if  (tryCount == maxTries) {
+                    LOG.warn("Cannot resolve {}", host);
+                    return ArrayUtils.STRING_EMPTY_ARRAY;
+                }
+
+                try {
+                    Thread.sleep(tryCount * 500L);

Review Comment:
   1. :+1: 
   2. An optimistic retry-with-backoff strategy - start with the expectation a 
momentary network outage, but subsequently wait increasingly longer durations 
for outage recovery so as to not spam the network too much.



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

To unsubscribe, e-mail: [email protected]

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

Reply via email to