-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-28050 RSProcedureDispatcher to fail-fast for krb auth failures #5391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
3a5bc01
a61c49f
4a79223
8549505
a8ba2ee
420fcb6
8b59b13
6fbfe4d
fbea61e
a8626fa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,7 @@ | |
| import java.util.List; | ||
| import java.util.Set; | ||
| import java.util.concurrent.TimeUnit; | ||
| import javax.security.sasl.SaslException; | ||
| import org.apache.hadoop.hbase.CallQueueTooBigException; | ||
| import org.apache.hadoop.hbase.DoNotRetryIOException; | ||
| import org.apache.hadoop.hbase.ServerName; | ||
|
|
@@ -306,6 +307,10 @@ private boolean scheduleForRetry(IOException e) { | |
| serverName, e.toString(), numberOfAttemptsSoFar); | ||
| return false; | ||
| } | ||
| if (isSaslError(e)) { | ||
| LOG.warn("{} is not reachable; give up", serverName, e); | ||
| return false; | ||
| } | ||
| if (e instanceof RegionServerAbortedException || e instanceof RegionServerStoppedException) { | ||
| // A better way is to return true here to let the upper layer quit, and then schedule a | ||
| // background task to check whether the region server is dead. And if it is dead, call | ||
|
|
@@ -330,6 +335,44 @@ private boolean scheduleForRetry(IOException e) { | |
| return true; | ||
| } | ||
|
|
||
| private boolean isSaslError(IOException e) { | ||
| if (e instanceof SaslException) { | ||
| return true; | ||
| } | ||
| // check 4 level of cause | ||
|
||
| Throwable cause = e.getCause(); | ||
| if (cause == null) { | ||
| return false; | ||
| } | ||
| if (isSaslError(cause)) { | ||
| return true; | ||
| } | ||
| cause = cause.getCause(); | ||
| if (cause == null) { | ||
| return false; | ||
| } | ||
| if (isSaslError(cause)) { | ||
| return true; | ||
| } | ||
| cause = cause.getCause(); | ||
| if (cause == null) { | ||
| return false; | ||
| } | ||
| if (isSaslError(cause)) { | ||
| return true; | ||
| } | ||
| cause = cause.getCause(); | ||
| if (cause == null) { | ||
| return false; | ||
| } | ||
| return isSaslError(cause); | ||
| } | ||
|
|
||
| private boolean isSaslError(Throwable cause) { | ||
|
||
| return cause instanceof IOException && unwrapException( | ||
| (IOException) cause) instanceof SaslException; | ||
| } | ||
|
|
||
| private long getMaxWaitTime() { | ||
| if (this.maxWaitTime < 0) { | ||
| // This is the max attempts, not retries, so it should be at least 1. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think here we need to follow the same pattern with CallQueueTooBigException, only if this is the first try, we can make sure that the task has not been sent yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good @Apache9, addressed in the latest revision