-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Connection timeout doesn't work for chunk-encoded requests #4402
Comments
This would be resolved by moving to use urllib3's chunked encoding logic as well. I concur with @sigmavirus24's notes on another issue: if we can get some socket-level tests of our chunked handling, we can move to using urllib3's logic to resolve this issue. |
In the consequence of that bug, when using with sessions, the chunked request have a timeout from the http request previously executed on that connection (!) if any... I've spent some time to explain why sometimes timeout happened and sometimes not. |
@ddzialak comment is important: it's a nasty issue to debug. I assume this is fixed by #5128, merged but not released yet. |
Requests is now using urllib3's chunking API |
Original issue was #1422, but I was able to reproduce in 2.18.4.
Expected Result
Chunk-encoded requests timeout after the specified timeout if the server does not respond.
Actual Result
Request holds connection open and never times out.
Reproduction Steps
First, run a test server that accepts POST requests and waits 10 seconds before responding:
Then, in another REPL, verify timeout works for non-chunk-encoded requests:
A timeout exception should be thrown.
Then, verify timeout does not work for chunk-encoded requests:
A
<Response [200]>
will be returned, indicating that the timeout did not work properly (a timeout exception should have been thrown instead).System Information
Workaround
Insert the following on line 454 of requests/adapters.py:
The text was updated successfully, but these errors were encountered: