-
Notifications
You must be signed in to change notification settings - Fork 9.1k
HADOOP-17092. ABFS: Making AzureADAuthenticator.getToken() throw HttpException if a… #2123
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
HADOOP-17092. ABFS: Making AzureADAuthenticator.getToken() throw HttpException if a… #2123
Conversation
…ll the retries are failed. This is to indiacate no retry is required at AbfsRestOperation.executeHttpOperation(). Introduced delay inbetween retries.
Javadoc is failing in the trunk as well. Please find the JIRA HADOOP-17085 Driver test results using accounts in Central India Account with HNS Support Account without HNS support |
Driver test results using accounts in Central India Account with HNS Support Account without HNS support |
💔 -1 overall
This message was automatically generated. |
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.
Mention the JIRA number in the PR title.
* @return {@link AzureADToken} obtained using the creds | ||
* @throws IOException throws IOException if there is a failure in connecting to Azure AD | ||
*/ | ||
public static AzureADToken getTokenUsingClientCreds(String authEndpoint, | ||
String clientId, String clientSecret) | ||
String clientId, | ||
String clientSecret, ExponentialRetryPolicy tokenFetchRetryPolicy) |
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.
Indentation.
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.
Done
|
||
int httperror = 0; | ||
IOException ex = null; | ||
boolean succeeded = false; | ||
int retryCount = 0; | ||
boolean shouldRetry; | ||
LOG.debug("First execution of REST operation getTokenSingleCall"); |
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.
Make this a trace level log.
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.
Done
throws IOException { | ||
AzureADToken token = null; | ||
ExponentialRetryPolicy retryPolicy |
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.
As every OAuth token provider eventually calls this method to get token, you will just need to create an instance of exponential retry right here with the configured values ?
Is there any benefit creating and passing down exponential retry instance from each of the token provider ?
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.
Done
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.
Done
Maybe track in different JIRA, but test/fixes to ensure token fetch code is identifying recoverable (i.e 'should retry') and non-recoverable scenarios correctly. non-recoverable one shouldn't be retried. |
💔 -1 overall
This message was automatically generated. |
Driver test results using accounts in Central India Account with HNS Support Account without HNS support |
Driver test results using accounts in Central India Account with HNS Support Account without HNS support |
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.
Looks good. Fix the checkstyle issue before commit.
💔 -1 overall
This message was automatically generated. |
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.
just need one minor fix, then it would be good to go
@@ -50,6 +50,7 @@ | |||
import com.google.common.annotations.VisibleForTesting; | |||
import com.google.common.base.Preconditions; | |||
import com.google.common.base.Strings; | |||
import org.apache.hadoop.fs.azurebfs.oauth2.AzureADAuthenticator; |
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.
order
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.
done
💔 -1 overall
This message was automatically generated. |
Fixing import order
50b203c
to
2b1886b
Compare
💔 -1 overall
This message was automatically generated. |
not going to suggest any changes of my own. One thing to know in future is that one of the hadoop retry policies takes a map of other policies and dynamically chooses the correct one based on the exception raised. Not needed here with only two exceptions treated as recoverable, but if you want to do more complex things, especially handle throttling, worth looking at see org.apache.hadoop.fs.s3a.S3ARetryPolicy for it in action |
💔 -1 overall
This message was automatically generated. |
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.
LGTM, +1
Sure. |
ABFS: Making AzureADAuthenticator.getToken() throw HttpException if all the retries are failed. This is to indiacate no retry is required at AbfsRestOperation.executeHttpOperation(). Introduced delay inbetween retries.
Test cases are not added as the change is in a private static method.
Driver test results using accounts in Central India
mvn -T 1C -Dparallel-tests=abfs -Dscale -DtestsThreadCount=8 clean verify
Account with HNS Support
[INFO] Tests run: 63, Failures: 0, Errors: 0, Skipped: 0
[WARNING] Tests run: 436, Failures: 0, Errors: 0, Skipped: 74
[WARNING] Tests run: 206, Failures: 0, Errors: 0, Skipped: 24
Account without HNS support
[INFO] Tests run: 63, Failures: 0, Errors: 0, Skipped: 0
[WARNING] Tests run: 436, Failures: 0, Errors: 0, Skipped: 248
[WARNING] Tests run: 206, Failures: 0, Errors: 0, Skipped: 24