Open ironaimer opened 1 year ago
I may be wrong, but that's not how I read it:
attempt
is initially set to 1
(request.ex:20
).attempt_again?
is called. Now in this circumstance:
max_attempts
is 1
, the >= condition will match and we'll fail.max_attempts
is 2
, the >= condition will not match, and we'll go to the else
blockattempt
count, and loop back and try again. So we'll get 2 attempts, as per the config option.
Environment
Elixir & Erlang versions (elixir --version): Erlang/OTP 23, Interactive Elixir (1.10.4)
ExAws version
mix deps |grep ex_aws
2.0.2HTTP client version. IE for hackney do
mix deps | grep hackney
1.16Current behavior
In case of SQS unavailability retry cycle is executed one iteration less than expected.
It seems strict ">" should be used in attempt_again? in request.ex as "attempt" starts from 1.
So retry cycle is executed (max_attempts - 1) times.
Expected behavior
Retry cycle should be executed max_attempts times.