adoroszlai commented on a change in pull request #2772:
URL: https://github.com/apache/ozone/pull/2772#discussion_r746443205



##########
File path: 
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/ha/OMFailoverProxyProvider.java
##########
@@ -451,8 +453,9 @@ public synchronized long getWaitTime() {
     return waitBetweenRetries;
   }
 
-  public synchronized boolean shouldFailover(Exception ex) {
-    if (OmUtils.isAccessControlException(ex)) {
+  private synchronized boolean shouldFailover(Exception ex) {
+    Throwable unwrappedException = HddsUtils.getUnwrappedException(ex);
+    if (unwrappedException instanceof AccessControlException) {

Review comment:
       `TestDelegationToken` is failing because client retries on 
`SecretManager.InvalidToken`:
   
   ```
   2021-11-10 11:01:05,004 [Listener at 0.0.0.0/9862] INFO  
retry.RetryInvocationHandler (RetryInvocationHandler.java:log(411)) - 
com.google.protobuf.ServiceException: 
org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.token.SecretManager$InvalidToken):
 token (OzoneToken owner=om/[email protected], renewer=om, realUser=, 
issueDate=2021-11-10T10:00:06.408Z, maxDate=2021-11-17T10:00:06.408Z, 
sequenceNumber=1, masterKeyId=1, strToSign=null, signature=null, 
awsAccessKeyId=null, omServiceId=omServiceIdDefault) can't be found in cache, 
while invoking $Proxy38.submitRequest over nodeId=null,nodeAddress=0.0.0.0:9862 
after 7 failover attempts. Trying to failover after sleeping for 16000ms.
   ```
   
   It seems SCM's and OM's version of `isAccessControlException` was different 
in this respect:
   
   
https://github.com/apache/ozone/blob/96e2d7f94075474e6fe8ebf0ee31b2ee3855fbfe/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java#L633-L634
   
   ```suggestion
       if (unwrappedException instanceof AccessControlException ||
           unwrappedException instanceof SecretManager.InvalidToken) {
   ```

##########
File path: 
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/ha/OMFailoverProxyProvider.java
##########
@@ -54,6 +55,7 @@
 import org.apache.hadoop.ozone.om.exceptions.OMLeaderNotReadyException;
 import org.apache.hadoop.ozone.om.exceptions.OMNotLeaderException;
 import 
org.apache.hadoop.ozone.om.protocolPB.OzoneManagerProtocolClientSideTranslatorPB;
+import org.apache.hadoop.security.AccessControlException;
 import org.apache.hadoop.security.UserGroupInformation;

Review comment:
       (Needed for other code suggestion)
   
   ```suggestion
   import org.apache.hadoop.security.AccessControlException;
   import org.apache.hadoop.security.UserGroupInformation;
   import org.apache.hadoop.security.token.SecretManager;
   ```




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to