-
Notifications
You must be signed in to change notification settings - Fork 9.2k
HADOOP-17873. ABFS: Fix transient failures in ITestAbfsStreamStatistics and ITestAbfsRestOperationException #3341
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 4 commits
1c28597
db02e3b
4071216
dc2f22e
b0b3aac
c78d183
5f5b332
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 |
|---|---|---|
|
|
@@ -30,30 +30,34 @@ | |
| */ | ||
| public class RetryTestTokenProvider implements CustomTokenProviderAdaptee { | ||
|
|
||
| // Need to track first token fetch otherwise will get counted as a retry too. | ||
| private static boolean isThisFirstTokenFetch = true; | ||
| public static int reTryCount = 0; | ||
| private static final Logger LOG = LoggerFactory.getLogger( | ||
| RetryTestTokenProvider.class); | ||
|
|
||
| private static final Logger LOG = LoggerFactory | ||
| .getLogger(RetryTestTokenProvider.class); | ||
| // Need to track first token fetch otherwise will get counted as a retry too. | ||
| private boolean isThisFirstTokenFetch = true; | ||
| private int retryCount = 0; | ||
|
|
||
| @Override | ||
| public void initialize(Configuration configuration, String accountName) | ||
| throws IOException { | ||
|
|
||
| } | ||
|
|
||
| public static void ResetStatusToFirstTokenFetch() { | ||
| /** | ||
| * Clear earlier retry details and reset RetryTestTokenProvider instance to | ||
| * state of first access token fetch call | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: add a .
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added When parallel is set to "classes" (instead of "both"), the StreamStats test passes even with the failure scenario induced by dummy test, as the two tests are run sequentially in the process. However, I guess there might be occasional failures if a different class reads/writes simultaneously in a different process; could not reproduce failure though. Have made a minor correction to the pom file; the test will be excluded from the parallel run (currently classesandMethods/both) and executed separately along with a bunch of other integration tests that need to be run sequentially |
||
| */ | ||
| public void resetStatusToFirstTokenFetch() { | ||
|
steveloughran marked this conversation as resolved.
|
||
| isThisFirstTokenFetch = true; | ||
| reTryCount = 0; | ||
| retryCount = 0; | ||
| } | ||
|
|
||
| @Override | ||
| public String getAccessToken() throws IOException { | ||
| if (isThisFirstTokenFetch) { | ||
| isThisFirstTokenFetch = false; | ||
| } else { | ||
| reTryCount++; | ||
| retryCount++; | ||
| } | ||
|
|
||
| LOG.debug("RetryTestTokenProvider: Throw an exception in fetching tokens"); | ||
|
|
@@ -64,4 +68,13 @@ public String getAccessToken() throws IOException { | |
| public Date getExpiryTime() { | ||
| return new Date(); | ||
| } | ||
|
|
||
| public static RetryTestTokenProvider getCurrentRetryTestProviderInstance( | ||
| AccessTokenProvider customTokenProvider) { | ||
| return (RetryTestTokenProvider) ((CustomTokenProviderAdapter) customTokenProvider).getCustomTokenProviderAdaptee(); | ||
| } | ||
|
|
||
| public int getRetryCount() { | ||
| return retryCount; | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.