Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-13206

Consolidate multiple levels of retries for AWS IOs

Details

    • Improvement
    • Status: Resolved
    • P3
    • Resolution: Fixed
    • None
    • 2.38.0
    • io-java-aws

    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

          Activity

            People

              mosche Moritz Mack
              mosche Moritz Mack
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: