-
Couldn't load subscription status.
- Fork 9.1k
HADOOP-18310 Add option and make 400 bad request retryable #4483
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
base: trunk
Are you sure you want to change the base?
Changes from all commits
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 |
|---|---|---|
|
|
@@ -214,7 +214,10 @@ protected Map<Class<? extends Exception>, RetryPolicy> createExceptionMap() { | |
|
|
||
| // policy on a 400/bad request still ambiguous. | ||
| // Treated as an immediate failure | ||
| policyMap.put(AWSBadRequestException.class, fail); | ||
| RetryPolicy awsBadRequestExceptionRetryPolicy = | ||
|
||
| configuration.getBoolean(FAIL_ON_AWS_BAD_REQUEST, DEFAULT_FAIL_ON_AWS_BAD_REQUEST) ? | ||
| fail : retryIdempotentCalls; | ||
|
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.
I think we would also want to log at warn that this is happening, assuming this is rare. |
||
| policyMap.put(AWSBadRequestException.class, awsBadRequestExceptionRetryPolicy); | ||
|
|
||
| // Status 500 error code is also treated as a connectivity problem | ||
| policyMap.put(AWSStatus500Exception.class, connectivityFailure); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -311,12 +311,25 @@ public void testRetryAWSConnectivity() throws Throwable { | |
| */ | ||
| @Test(expected = AWSBadRequestException.class) | ||
| public void testRetryBadRequestNotIdempotent() throws Throwable { | ||
| invoker.retry("test", null, false, | ||
|
|
||
| invoker.retry("test", null, true, | ||
| () -> { | ||
| throw BAD_REQUEST; | ||
| }); | ||
| } | ||
|
|
||
| @Test | ||
| public void testRetryBadRequestIdempotent() throws Throwable { | ||
|
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. test looks ok. |
||
| Configuration conf = new Configuration(FAST_RETRY_CONF); | ||
| conf.setBoolean(FAIL_ON_AWS_BAD_REQUEST, false); | ||
| S3ARetryPolicy retryPolicy = new S3ARetryPolicy(conf); | ||
|
|
||
| IOException ex = translateException("GET", "/", BAD_REQUEST); | ||
| assertRetryAction("Expected retry on aws bad request", | ||
| retryPolicy, RetryPolicy.RetryAction.RETRY, | ||
| ex, 1, true); | ||
| } | ||
|
|
||
| @Test | ||
| public void testConnectionRetryPolicyIdempotent() throws Throwable { | ||
| assertRetryAction("Expected retry on connection timeout", | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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 now think "fs.s3a.retry.on.400.response.enabled" would be better, with default flipped. docs would say "experimental"
and assuming we do have a custom policy, adjacent