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/18 07:43:38 UTC

[GitHub] [hadoop-ozone] swagle opened a new pull request #693: HDDS-3220. Filesystem client should not retry on AccessControlException.

swagle opened a new pull request #693: HDDS-3220. Filesystem client should not retry on AccessControlException.
URL: https://github.com/apache/hadoop-ozone/pull/693
 
 
   ## What changes were proposed in this pull request?
   Change retry policy on the client is the exception is of type AccessControlException.
   
   ## What is the link to the Apache JIRA
   https://issues.apache.org/jira/browse/HDDS-3220
   
   ## How was this patch tested?
   Verified fix running ozone secure using docker. I will add an integration test later.

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


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

Posted by GitBox <gi...@apache.org>.
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


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

Posted by GitBox <gi...@apache.org>.
arp7 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_r394438647
 
 

 ##########
 File path: hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/protocolPB/OzoneManagerProtocolClientSideTranslatorPB.java
 ##########
 @@ -292,13 +295,30 @@ 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();
+      if (t instanceof IOException) {
+        t = t.getCause();
+        if (t instanceof IOException) {
 
 Review comment:
   Wow is it wrapped that deeply? Can we make this check a bit more robust, if any of the nested exceptions is an instanceOf `AccessControlException` and also check in a loop while `getCause` returns non-nill?

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


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

Posted by GitBox <gi...@apache.org>.
dineshchitlangia merged pull request #693: HDDS-3220. Filesystem client should not retry on AccessControlException.
URL: https://github.com/apache/hadoop-ozone/pull/693
 
 
   

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


[GitHub] [hadoop-ozone] swagle commented on issue #693: HDDS-3220. Filesystem client should not retry on AccessControlException.

Posted by GitBox <gi...@apache.org>.
swagle commented on issue #693: HDDS-3220. Filesystem client should not retry on AccessControlException.
URL: https://github.com/apache/hadoop-ozone/pull/693#issuecomment-600831012
 
 
   > LGTM, +1.
   
   Thanks @xiaoyuyao for the review.

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


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

Posted by GitBox <gi...@apache.org>.
swagle 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_r394515008
 
 

 ##########
 File path: hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/protocolPB/OzoneManagerProtocolClientSideTranslatorPB.java
 ##########
 @@ -292,13 +295,30 @@ 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();
+      if (t instanceof IOException) {
+        t = t.getCause();
+        if (t instanceof IOException) {
 
 Review comment:
   Oh yes, doing the same, thanks!

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


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

Posted by GitBox <gi...@apache.org>.
arp7 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_r394438647
 
 

 ##########
 File path: hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/protocolPB/OzoneManagerProtocolClientSideTranslatorPB.java
 ##########
 @@ -292,13 +295,30 @@ 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();
+      if (t instanceof IOException) {
+        t = t.getCause();
+        if (t instanceof IOException) {
 
 Review comment:
   Wow is it wrapped that deeply? Can we make this check a bit more robust, if any of the nested exceptions is an instanceOf `AccessControlException` and also check in a loop while `getCause` returns non-null?

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


[GitHub] [hadoop-ozone] swagle commented on issue #693: HDDS-3220. Filesystem client should not retry on AccessControlException.

Posted by GitBox <gi...@apache.org>.
swagle commented on issue #693: HDDS-3220. Filesystem client should not retry on AccessControlException.
URL: https://github.com/apache/hadoop-ozone/pull/693#issuecomment-600997211
 
 
   Thank you @dineshchitlangia for review and merge.

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


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

Posted by GitBox <gi...@apache.org>.
arp7 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_r394503942
 
 

 ##########
 File path: hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/protocolPB/OzoneManagerProtocolClientSideTranslatorPB.java
 ##########
 @@ -292,13 +295,30 @@ 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();
+      if (t instanceof IOException) {
+        t = t.getCause();
+        if (t instanceof IOException) {
 
 Review comment:
   I meant - can we keep checking for ACE until we finally get null? I am not sure if any server side changes could impact how the exception is wrapped e.g. introduce more nesting.

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


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

Posted by GitBox <gi...@apache.org>.
swagle 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_r394795579
 
 

 ##########
 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:
   @dineshchitlangia  Because the null check is redundant, instanceOf operator is null safe and returns false if obj reference is null.

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


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

Posted by GitBox <gi...@apache.org>.
swagle 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_r394500132
 
 

 ##########
 File path: hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/protocolPB/OzoneManagerProtocolClientSideTranslatorPB.java
 ##########
 @@ -292,13 +295,30 @@ 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();
+      if (t instanceof IOException) {
+        t = t.getCause();
+        if (t instanceof IOException) {
 
 Review comment:
   null check is covered by instanceof operator which returns false if ex is null.
   Making a change for checking ACE on each level.

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


[GitHub] [hadoop-ozone] swagle commented on issue #693: HDDS-3220. Filesystem client should not retry on AccessControlException.

Posted by GitBox <gi...@apache.org>.
swagle commented on issue #693: HDDS-3220. Filesystem client should not retry on AccessControlException.
URL: https://github.com/apache/hadoop-ozone/pull/693#issuecomment-600471491
 
 
   cc: @arp7 and @mukul1987 

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