From 317f317d4b9f8db4b55039227c7e13baac337544 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Elek?= Date: Sun, 9 Sep 2018 23:26:55 +0200 Subject: [PATCH] HDDS-421. Resilient DNS resolution in datanode-service. Contributed by Elek, Marton. --- .../common/states/datanode/InitDatanodeState.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/states/datanode/InitDatanodeState.java b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/states/datanode/InitDatanodeState.java index f04d392532..b348327973 100644 --- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/states/datanode/InitDatanodeState.java +++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/states/datanode/InitDatanodeState.java @@ -92,6 +92,16 @@ public class InitDatanodeState implements DatanodeState, LOG.error("Null or empty SCM address list found."); return DatanodeStateMachine.DatanodeStates.SHUTDOWN; } else { + for (InetSocketAddress addr : addresses) { + if (addr.isUnresolved()) { + LOG.warn("One SCM address ({}) can't (yet?) be resolved. Postpone " + + "initialization.", addr); + + //skip any further initialization. DatanodeStateMachine will try it + // again after the hb frequency + return this.context.getState(); + } + } for (InetSocketAddress addr : addresses) { connectionManager.addSCMServer(addr); }