rpuch commented on code in PR #7188:
URL: https://github.com/apache/ignite-3/pull/7188#discussion_r2609527683
##########
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:
With 3 attempts which we currently have this means 2 delays at max; the
backoff-induced increase will only happen once. Is it worth the hussle?
--
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]