socket.getaddrinfo() block forever when using with gevent

亡梦爱人 提交于 2019-12-11 09:18:29

问题


Using httplib2, I am sending multiple requests with gevent, after some time http.request() method of httplib2 is getting blocked forever.
On checking I found that blocking function is socket.getaddrinfo() in httplib2 link.


回答1:


set default timeout using socket.setdefaulttimeout(). since timeout of getaddrinfo is not specified it will use default timeout.



来源:https://stackoverflow.com/questions/24883247/socket-getaddrinfo-block-forever-when-using-with-gevent

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!