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_r394627535
 
 

 ##########
 File path: 
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/ha/OMFailoverProxyProvider.java
 ##########
 @@ -191,20 +192,19 @@ public Text getCurrentProxyDelegationToken() {
   private Text computeDelegationTokenService() {
     // For HA, this will return "," separated address of all OM's.
     StringBuilder rpcAddress = new StringBuilder();
-    int count = 0;
+
     for (Map.Entry<String, OMProxyInfo> omProxyInfoSet :
         omProxyInfos.entrySet()) {
-      count++;
-      rpcAddress =
-          rpcAddress.append(
-              omProxyInfoSet.getValue().getDelegationTokenService());
+      Text dtService = omProxyInfoSet.getValue().getDelegationTokenService();
 
-      if (omProxyInfos.size() != count) {
-        rpcAddress.append(",");
+      // dtService can be null when during client object creation when one of
+      // the OM configured address in unreachable.
+      if (dtService != null) {
+        rpcAddress.append(",").append(rpcAddress);
 
 Review comment:
   As we discussed offline, can you add a TODO to fix the computed DTService 
when the dtService is temporarily avialable due to OM instance reboot, DNS 
issue? 

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

Reply via email to