ex-aws / ex_aws

A flexible, easy to use set of clients AWS APIs for Elixir
https://hex.pm/packages/ex_aws
MIT License
1.29k stars 529 forks source link

Configurable max attempts for client errors #1094

Closed studzien closed 3 weeks ago

studzien commented 1 month ago

We want to be able to apply different retry strategies depending on the error type we get back from AWS. More specifically:

  1. We don't want to retry throughput exceeded errors to fail fast in case we temporarily overloaded AWS and bubble up the backpressure to the caller.
  2. If AWS has some internal problems and returns 500 errors for a few seconds, we want to retry them.

This PR proposes a naive approach to enabling different max_attempts to be applied to the client errors (400..499).

A more sophisticated approach is to override the whole retry strategy (including backoff values) for specific errors or error ranges.

bernardd commented 3 weeks ago

Looks good, thanks @studzien!