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 2021/11/04 08:30:14 UTC

[GitHub] [ozone] adoroszlai commented on a change in pull request #2772: HDDS-5872. Do not failover on some RpcExceptions

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



##########
File path: hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java
##########
@@ -621,23 +622,27 @@ public static String getOzoneManagerServiceId(OzoneConfiguration conf)
 
   /**
    * Unwrap exception to check if it is some kind of access control problem
-   * ({@link AccessControlException} or {@link SecretManager.InvalidToken}).
+   * ({@link AccessControlException} or {@link SecretManager.InvalidToken})
+   * or a RpcException.
    */
-  public static boolean isAccessControlException(Exception ex) {
+  public static Throwable getUnwrappedException(Exception ex) {
     if (ex instanceof ServiceException) {
       Throwable t = ex.getCause();
       if (t instanceof RemoteException) {
         t = ((RemoteException) t).unwrapRemoteException();
       }
       while (t != null) {
+        if (t instanceof RpcException) {
+          return t;
+        }
         if (t instanceof AccessControlException ||
             t instanceof SecretManager.InvalidToken) {
-          return true;
+          return t;

Review comment:
       Nit: can we merge these two identical `if` blocks?




-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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