HDDS-421. Resilient DNS resolution in datanode-service. Contributed by Elek, Marton.

This commit is contained in:
Márton Elek 2018-09-09 23:26:55 +02:00
parent 8fe4062bfc
commit 317f317d4b

View File

@ -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);
}