Closed myronmarston closed 3 months ago
thx for the report @myronmarston . branch gh-54
contains a fix for your issue.
There is a small caveat in your example, which did not make it "apples to apples", as net-http does not reuse connections, while httpx does, in certain conditions. this should be an exception though, which has been corrected now.
When using the Faraday adapter, I've observed that per-request timeouts do not appear to work correctly. Whatever timeout value is set on the first request of the faraday connection gets re-used for all subsequent requests.
Here's a script that reproduces this bug:
When I run it using the
net_http
adapter, you can see that the timeout set on each request is honored:In this case, whichever request has a 10 second timeout succeeds, while the request with a 1 second timeout gets
Faraday::TimeoutError
. In contrast, when I run this using thehttpx
adapter, whatever timeout value is set on the first request gets reused on the 2nd request: