Skip to content
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

gevent socket does not raise SocketTimeout and Timeouts fail #69

Closed
lukecampbell opened this issue Apr 30, 2012 · 2 comments
Closed

gevent socket does not raise SocketTimeout and Timeouts fail #69

lukecampbell opened this issue Apr 30, 2012 · 2 comments

Comments

@lukecampbell
Copy link

The gevent monkey patching on socket for some reason (have yet to find out why) does not properly raise a SocketTimeout the way it should and as a consequence urllib3 will not raise a Timeout properly if you're using gevent.

How to reproduce:
Create unresponsive socket (simulate timeout)

nc -l 8080
from gevent.monkey import patch_all
patch_all()
import urllib3
http = urllib3.PoolManager()
r = http.request('GET', 'http://localhost:8080/',timeout=1)

The Timeout is never raised.

One solution is to use gevent.socket when making the connection, that should properly raise a SocketTimeout.

@shazow
Copy link
Member

shazow commented Jun 16, 2012

Sorry for the superlate response.

That is an annoying bug indeed. Any thoughts on how to implement it in such a way that it won't break other platforms?

@wynnw
Copy link

wynnw commented Jun 20, 2012

This is a gevent bug - I ran into it today. It appears to have been fixed in this gevent commit:
https://bitbucket.org/denis/gevent/changeset/65968cf1baa9

Hopefully a 1.0b3 will come out soon with that fix.

@shazow shazow closed this as completed Jul 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants