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
Net::HTTP adapter retries requests automatically #774
Comments
…P requests twice See lostisland/faraday#774 and ankane/the-ultimate-guide-to-ruby-timeouts#8. Unbelievable that it does this unconditionally. Saying that, including a new HTTP library seems overkill.
I've been looking at this issue. One approach mentioned in #771 is to set the default to 0, but change it depending on the amount of retries configured. We would have to make the Retry middleware aware of the underlying adapter (as some adapters might not support this), and conditionally apply this logic in the As an alternative to said approach, we can set it to do no retries, instead keeping the retry logic confined to the Retry middleware. Whatever the outcome, I'd be more than happy to pick this up @iMacTia . |
I was definitely thinking at the second option. All we need to do in this case is to tell Net::HTTP adapter to set |
@iMacTia - I couldn't agree more. In that case, I shall pick this up. |
Basic Info
Issue description
When using
Net::HTTP
as adapter, users get surprised by the retry strategy provided byNet::HTTP
. This brings to different "issues" (e.g. #612 and #771).There's not much we can do for Ruby <= 2.4, however Ruby 2.5 provides a new
max_retries
config forNet::HTTP
so Faraday should set that automatically when available.Steps to reproduce
See issues #612 and #771.
The text was updated successfully, but these errors were encountered: