-
Notifications
You must be signed in to change notification settings - Fork 185
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
Timeout makes the next request to the same domain fail #18
Comments
Out of curiosity, if I am going to handle this case myself, is it sufficient to catch the |
@justinfx sounds good. I'd start from a test looking like this: def handler(request):
if request.number == 1:
time.sleep(0.6)
return tests.http_response_bytes(status=500)
return tests.http_response_bytes(status=200)
http = httplib2.Http(timeout=0.5)
with tests.server_request(handler, request_count=2) as uri:
with tests.assert_raises(...):
http.request(uri)
response, _ = http.request(uri)
assert response.status == 200 |
@temoto I have a fix and a test locally. The fix works when I manually verify it, but I am having some trouble getting it to replicate the broken behaviour in the test because of the way it seems a new connection is being swapped in already by the test behaviour. I will end up submitting a wip MR for this, but thought in the meantime I would ask to see if you know off the top of your head why the test would be side stepping the standard logic of the same connection being reused on the second request? |
@justinfx I don't see your code. |
nice! I was just about to fix this myself ;) |
@justinfx commits fixed my issue as well |
Please try latest release v0.12.0 with Justin fix. |
@justinfx yes I confused things up, sorry. |
Fix by Justin is merged in master now. |
Thanks! |
Can this be closed now? |
@max-sixty thanks |
Heya.
Whenever a request fail with a socket.timeout, the following request to the same domain fails. Example:
I'm using the latest httplib2 and python3
If this is expected, is there any way to really 'drop' the connection? Forcing a new connection instead.
The text was updated successfully, but these errors were encountered: