Details
-
Improvement
-
Status: Resolved
-
P3
-
Resolution: Fixed
-
None
Description
The current implementation of retries at the Beam IO level for AWS IOs is misleading and for that reason potentially harmful.
The AWS SDK automatically performs retries by default. In combination with retries implemented by various AWS IOs the number of requests under error might unexpectedly explode.
Instead of re-implementing retries on the IO level, respective retry configuration could be pushed down into the AWS client, e.g. changing the client providers to accept the RetryConfiguration as parameter.
With that we would get a consistent and transparent behavior. And at the same time we'd be able to remove lots of boilerplate code from the IOs.
Also, the default retry predicate is simply wrong and does not correctly check for any status code that can be retried. Yet another reason to remove any custom retry logic and push it down into the SDK. E.g. for DynamoDBIO, but same for SnsIO
private static class DefaultRetryPredicate implements RetryPredicate { private static final ImmutableSet<Integer> ELIGIBLE_CODES = ImmutableSet.of(HttpStatus.SC_SERVICE_UNAVAILABLE); @Override public boolean test(Throwable throwable) { return (throwable instanceof IOException || (throwable instanceof InternalErrorException) || (throwable instanceof InternalErrorException && ELIGIBLE_CODES.contains(((InternalErrorException) throwable).getStatusCode()))); } }
Attachments
Issue Links
- is fixed by
-
BEAM-13563 Generalize AWS client provider to be independent of client type
- Triage Needed