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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]