-
Notifications
You must be signed in to change notification settings - Fork 985
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
NetHttpPersistent: ConnectionError on OpenTimeout #1154
Conversation
7891b32
to
13d9257
Compare
@iMacTia Does this rhyme with how the other adapters handle open timeout? |
I took a look at the history, and learned that the net-http adapter treats it as a ConnectionError on purpose: 9ad0fcd |
Learning more: There was a recent release of net-http-persistent, which got in a new change. drbrain/net-http-persistent@2d23622 |
13d9257
to
6a90ae5
Compare
- open timeout is treated as a failure to connect - 4.0.0 and up supports this
6a90ae5
to
1d1ff2e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @olleolleolle for tackling this.
I had a closer look at the whole change and I suspect this change is being backwards-incompatible.
Tests will be passing, however updating Faraday while using net-http-persistent < 4.0
will probably break, as it will raise a different exception from before in case of timeout?
With this change, we basically stop testing for v3.0 and change the code to fit only v4.0
Feel free to point out if I'm misunderstanding.
Yes, to make this work for < 3.x + 3.x + 4.x, we need a new conditional in the "rescue and re-raise" section which this PR changed (and its tests). |
I THINK this is now fixed in #1226, although to keep backwards-compatibility I've kept |
Description
This PR adds a special-case from the net-http adapter to the net-http-persistent adapter.
open timeout was treated as a failure to connect, but our tests required it to be a timeout. Turns out, that was a call which was necessary before 4.0.0 of net-http-persistent.
There was a 4.0 released of net-http-timeout.
This change fixes the build by reraising as ConnectionError, just like in Faraday's
net-http
adapter.Fixes #1152 by making the build pass.
Questions for reviewer