我有幾個使用boto從Amazon S3讀取多個文件的守護進程。每隔幾天一次,我遇到了一個情況,即從boto內部深處拋出httplib.IncompleteRead。如果我嘗試重試請求,它會立即失敗並顯示另一個IncompleteRead。即使我打電話bucket.connection.close()
,所有進一步的請求仍然會出錯。Boto S3偶爾會拋出httplib.IncompleteRead
我覺得我可能已經偶然發現了boto中的一個bug,但似乎沒有人碰到它。難道我做錯了什麼?所有的守護進程都是單線程的,我試過設置is_secure
兩種方式。
Traceback (most recent call last):
...
File "<file_wrapper.py",> line 22, in next
line = self.readline()
File "<file_wrapper.py",> line 37, in readline
data = self.fh.read(self.buffer_size)
File "<virtualenv/lib/python2.6/site-packages/boto/s3/key.py",> line 378, in read
self.close()
File "<virtualenv/lib/python2.6/site-packages/boto/s3/key.py",> line 349, in close
self.resp.read()
File "<virtualenv/lib/python2.6/site-packages/boto/connection.py",> line 411, in read
self._cached_response = httplib.HTTPResponse.read(self)
File "/usr/lib/python2.6/httplib.py", line 529, in read
s = self._safe_read(self.length)
File "/usr/lib/python2.6/httplib.py", line 621, in _safe_read
raise IncompleteRead(''.join(s), amt)
環境:
- 亞馬遜EC2
- 的Ubuntu 11.10
- 的Python 2.6.7
- 寶途2.12.0
感謝您的努力,一個很好的例子。我還沒有找到一個很好的解決方案,但你應該得到的賞金比誰更;) – shx2
謝謝。:)如果我瞭解更多,我會回覆。 – Glenn
更新:https://groups.google.com/forum/?fromgroups#!topic/boto-users/YiPAOvxIrUY – Glenn