You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2020/03/19 04:54:54 UTC

[GitHub] [hadoop-ozone] dineshchitlangia commented on a change in pull request #693: HDDS-3220. Filesystem client should not retry on AccessControlException.

dineshchitlangia commented on a change in pull request #693: HDDS-3220. Filesystem client should not retry on AccessControlException.
URL: https://github.com/apache/hadoop-ozone/pull/693#discussion_r394790620
 
 

 ##########
 File path: hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/protocolPB/OzoneManagerProtocolClientSideTranslatorPB.java
 ##########
 @@ -292,13 +295,29 @@ private RetryAction getRetryAction(RetryAction fallbackAction,
     return proxy;
   }
 
+  /**
+   * Unwrap exception to check if it is a {@link AccessControlException}.
+   */
+  private boolean isAccessControlException(Exception ex) {
+    if (ex instanceof ServiceException) {
+      Throwable t = ex.getCause();
+      while (t != null) {
+        if (t instanceof AccessControlException) {
+          return true;
+        }
+        t = t.getCause();
+      }
+    }
+    return false;
+  }
+  
   /**
    * Check if exception is a OMNotLeaderException.
    * @return OMNotLeaderException.
    */
   private OMNotLeaderException getNotLeaderException(Exception exception) {
     Throwable cause = exception.getCause();
-    if (cause != null && cause instanceof RemoteException) {
+    if (cause instanceof RemoteException) {
 
 Review comment:
   @swagle Why are we skipping the null check for `cause` here and in line 338 ?
   
   Aside from this, rest of the code change LGTM.
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org