Created
December 22, 2011 23:32
-
-
Save mike-plivo/1512329 to your computer and use it in GitHub Desktop.
kennethreitz/requests issue 3239
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Some requests receive a Response but keep the socket in | |
CLOSE_WAIT state until process is killed . | |
Some requests raise ConnectionError after some time and | |
seem to block others unprocessed spawned requests until | |
all ConnectionError are not raised . | |
(all http connection pool slots are busy ?) | |
""" | |
from gevent import monkey | |
monkey.patch_all() | |
import gevent | |
import requests | |
def http_req(x): | |
r = requests.post('http://google.com') | |
print "Request ", x, r | |
if __name__ == '__main__': | |
reqs = [ gevent.spawn(http_req, x) for x in range(10) ] | |
print "waiting end of greenlets ..." | |
gevent.joinall(reqs) | |
print "sleeping for 120 sec" | |
gevent.sleep(120.0) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
do you have any solution for this problem,i struck in it so many time