Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
kennethreitz/requests issue 3239
"""
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)
@mygoda
Copy link

mygoda commented Jan 23, 2016

do you have any solution for this problem,i struck in it so many time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment