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
Retries retry_block
called BEFORE the retry, contrary to documentation
#1207
Comments
I was studying the
I was excepting to log something like |
Hi @luizkowalski and thanks for raising this issue! Still, I'm a bit conflicted on the next steps: should we update the documentation to make this clearer or attempt a fix so that setting the |
Trash my last comment, reviewing the code after a coffee I realised the
Unfortunately the above still applies though, I'm a bit reluctant about introducing breaking changes now as this might affect production applications where developers noticed this issue and coded around it instead of raising it as you did. |
So then you would say that the retry mechanism is actually working on my application because I don't see logging with
I totally agree with you though I think maybe a major upgrade should do fine and most developers should be aware of it when upgrading their gems, reading the Changelog, tests, etc.
well, that changes everything I guess...this would be a breaking change and a nice time to introduce those changes personally, I would be satisfied with documentation changes for now. I'm still a bit confused about the retry count I'm seeing on the logs, the whole 2 and 1 and no 0 |
@luizkowalski indeed, that's definitely something we should explore more 🤔! |
@iMacTia I did some investigation on our logging platform and actually found that it DID work on the third retry so we are safe here hahaha we didn't see a and now, looking back at it, I think it makes sense that we are seeing this maybe for now update the docs to reflect that the |
Closing this now, thank you @iMacTia for the clarifications |
Thanks for the feedback @luizkowalski and apologies for not replying before. |
retry_block
called BEFORE the retry, contrary to documentation
@iMacTia sure, no worries! thanks again! |
Basic Info
Issue description
I'm dealing with an unstable service that fails randomly and the solution provided by them is "just retry" (I know...)
I've been playing around with the Retry middleware but I can't get my head around a detail: how to know that the retries exhausted
Steps to reproduce
This is my retry configuration for 3 attempts:
and this is how I log the retry attempt:
I expected to see 3 entries on our logging platform but instead, I always see 2:
Digging in Faraday's code looks like that my assumption (
retries == 3
) is wrong since what Faraday does is decrease the counting instead of increasing the retry counting so looks like I should doretries.zero?
But these API call logs I showed above actually failed for good and I didn't get the third retry.
So my question is: how can I check for exhausted retries?
I can gladly update the documentation later if someone helps me understand it and clarify the retry/exhaust part
The text was updated successfully, but these errors were encountered: