
"/usr/lib/python2.7/ssl.py",line 305: self._sslobj.do_handshake()
我的问题是“为什么?”和“我能做些什么来解决它?”.
在发生这种情况之前,通常会持续一周左右.最后一次,处理tweepy挂起的4个线程中有3个挂起(第四个是等待来自挂起线程的信息).奇怪的是,线程挂起之间有相当长的延迟:首先,调用API.followers_IDs()的线程挂起,然后大约12分钟后调用API.frIEnds_IDs()的线程挂起,然后1小时12分钟后(!)线程调用API.search()挂起.在所有这些之间有许多API调用.
当我发送QUIT信号时,我在那里有一些代码来转储它的堆栈跟踪,并且我为挂起的线程获得了类似的内容.它们都是(和包括)第二个条目(tweepy / binder.py,第185行,_call部分)相同.另外两个来自tweepy / cursor.py,接下来的第85行和下一行的tweepy / cursor.py,第60行:
file "myTwitterScraPingScript.py",line 245,in checkStatus status = API.rate_limit_status() file "/scratch/bin/python-virtual-environments/tweepy-2/local/lib/python2.7/site-packages/tweepy/binder.py",line 185,in _call return method.execute() file "/scratch/bin/python-virtual-environments/tweepy-2/local/lib/python2.7/site-packages/tweepy/binder.py",line 146,in execute conn.request(self.method,url,@R_301_5548@s=self.@R_301_5548@s,body=self.post_data) file "/usr/lib/python2.7/httplib.py",line 958,in request self._send_request(method,body,@R_301_5548@s) file "/usr/lib/python2.7/httplib.py",line 992,in _send_request self.end@R_301_5548@s(body) file "/usr/lib/python2.7/httplib.py",line 954,in end@R_301_5548@s self._send_output(message_body) file "/usr/lib/python2.7/httplib.py",line 814,in _send_output self.send(msg) file "/scratch/bin/python-virtual-environments/tweepy-2/local/lib/python2.7/site-packages/tweepy/binder.py",in _send_output self.send(msg) file "/usr/lib/python2.7/httplib.py",line 776,in send self.connect() file "/usr/lib/python2.7/httplib.py",line 1161,in connect self.sock = ssl.wrap_socket(sock,self.key_file,self.cert_file) file "/usr/lib/python2.7/ssl.py",line 381,in wrap_socket ciphers=ciphers) file "/usr/lib/python2.7/ssl.py",line 143,in __init__ self.do_handshake() file "/usr/lib/python2.7/ssl.py",line 305,in do_handshake self._sslobj.do_handshake()
线程挂起的时候有几个错误.这不是太不寻常,虽然这个数字略高于正常水平.第四个看起来很有趣但它发生在线程挂起之前.
> [Errno 110]:在最后一次followers_IDs()调用之前,连接超时约7分钟(中间有许多各种API调用)
> [Errno 104]大约3分钟后由同行重置连接(再次,几次成功通话)
> [Errno 110]连接在最后一次frIEnds_IDs()调用前大约1.5分钟超时.这是在API.search()线程中,它在第一个threaad挂起前大约5分钟一直在等待 – 总共等待大约15分钟.
> [Errno 104]在来自frIEnds_IDs()线程的最后一条消息之前大约2毫秒的连接重置连接,并且在同一个线程中.刚刚收集的朋友ID的页面显示一切正常,并且这些调用没有错误.
> [Errno 104]在expert_IDs线程挂起约17分钟后,搜索线程挂起前一小时,搜索线程中的对等点重置连接.
> A无法在1.5分钟后发送请求TweepError.
> 3更多理由无法在接下来的45分钟内发送请求和[Errno 104]连接重置.
>在搜索线程最终挂起之前,大约有15个无错误的分钟,包含大量搜索和lookup_users调用.
以上是内存溢出为你收集整理的python – 在ssl do_handshake()上挂着的Tweepy 2.0全部内容,希望文章能够帮你解决python – 在ssl do_handshake()上挂着的Tweepy 2.0所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)