在 python 线程中,我执行以下语句:
(response, content) = httplib2.Http().request(endpoint, 'POST', body=data, headers={ 'content-type': 'application/rdf+xml' })
大多数时候它成功了。但我间歇性地遇到以下错误:
File "/usr/local/lib/python2.7/dist-packages/dataStoreManager.py", line 31, in loadData
(response, content) = httplib2.Http().request(endpoint, 'POST', body=data, headers={ 'content-type': 'application/rdf+xml' })
File "/usr/local/lib/python2.7/dist-packages/httplib2-0.8-py2.7.egg/httplib2/__init__.py", line 1570, in request
(response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
File "/usr/local/lib/python2.7/dist-packages/httplib2-0.8-py2.7.egg/httplib2/__init__.py", line 1317, in _request
(response, content) = self._conn_request(conn, request_uri, method, body, headers)
File "/usr/local/lib/python2.7/dist-packages/httplib2-0.8-py2.7.egg/httplib2/__init__.py", line 1286, in _conn_request
response = conn.getresponse()
File "/usr/lib/python2.7/httplib.py", line 1022, in getresponse
raise ResponseNotReady()
如果相关,我尝试从西部区域的笔记本电脑连接到我们东部区域的 EC2 实例
怎么了?
我有 20 个线程(大部分时间似乎都可以正常工作),每个线程都执行以下代码;
(response, content) = httplib2.Http().request(endpoint, 'POST', body=data, headers={ 'content-type': 'application/rdf+xml' })
print "Response %s" % response.status