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


##########
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:
   On the other hand, it would be great to extract number of attempts to a 
constant (could you please do it?), and in such case backoff probably makes 
sense



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