No Retry in HTTPResponse.read() method.
See original GitHub issueIt appears that the retry support in urllib3 doesn’t cover the HTTPResponse.read() method. This means that if you pass preload_content=False to urlopen() as requests does, that any errors that occur while read()ing the body will not automatically be retried. Doing this transparently would be difficult to do since urllib3 doesn’t know what the calling library has done with the parts of the body it’s already received.
What would be nice though is to provide the Retry() object on the response object and provide instructions for how the caller of the library can use it to implement retries themselves. Perhaps this could look something like:
response = pool.urlopen(...)
while not response.closed and not response.retries.is_exhausted():
try:
data = []
data.append(response.read(4096))
except response.retries.exceptions as exc:
# This would raise an error if there are no more retries
response = response.retry()
Thoughts?
Issue Analytics
- State:
- Created 9 years ago
- Comments:11 (9 by maintainers)
Top Results From Across the Web
Is there any possibility to retry only Python low-level urllib3 ...
The server side is external, aka non-manageable by me, only the client side. I see no any possible way to have retry on...
Read more >Response and Decoders - urllib3 1.26.13 documentation
Unread data in the HTTPResponse connection blocks the connection from being released back to the pool. Returns underlying file descriptor if one exists....
Read more >http.client — HTTP protocol client — Python 3.11.1 ...
getresponse() when the attempt to read the response results in no data read from the connection, indicating that the remote end has closed...
Read more >Status codes in HTTP - W3C
Server has received the request but there is no information to send back, and the client should stay in the same document view....
Read more >common - Go Documentation Server
Request, details ClientCallDetails) (response *http.Response, err error) · func ... provider do not return an error, this method will not check AuthType(), ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Nope
any progress on this?