xiaoyuyao commented on a change in pull request #695: HDDS-3137. OM RpcClient fail with java.lang.IllegalArgumentException. URL: https://github.com/apache/hadoop-ozone/pull/695#discussion_r394626645
########## File path: hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/ha/OMProxyInfo.java ########## @@ -21,23 +21,48 @@ import org.apache.hadoop.io.Text; import org.apache.hadoop.net.NetUtils; import org.apache.hadoop.security.SecurityUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.net.InetSocketAddress; /** * Class to store OM proxy information. */ public class OMProxyInfo { + private String serviceId; private String nodeId; private String rpcAddrStr; private InetSocketAddress rpcAddr; private Text dtService; - OMProxyInfo(String nodeID, String rpcAddress) { + private static final Logger LOG = + LoggerFactory.getLogger(OMProxyInfo.class); + + OMProxyInfo(String serviceID, String nodeID, String rpcAddress) { + this.serviceId = serviceID; this.nodeId = nodeID; this.rpcAddrStr = rpcAddress; this.rpcAddr = NetUtils.createSocketAddr(rpcAddrStr); - this.dtService = SecurityUtil.buildTokenService(rpcAddr); + if (rpcAddr.isUnresolved()) { + LOG.warn("OzoneManager address {} for serviceID {} remains unresolved " + + "for node ID {} Check your ozone-site.xml file to ensure ozone " + + "manager addresses are configured properly.", + rpcAddress, serviceId, nodeId); + } + + // This issue will be a problem with docker/kubernetes world where one of + // the container is killed, and that OM address will be unresolved. For now + // skip the unresolved OM address setting it to the token service field. + + // TODo: Retry rpcAddr when unresolved during getProxy which will be used + // until next fail over. Fix setting of dtService also at that time. + try { Review comment: should we attempt this iif rpcAddr.isUnresolved()is false? ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org