使用异步URL Fetch时,我会收到如下的间歇性错误:
对于300次提取,我得到了大约20篇论文。难道我做错了什么?或者这是一个错误吗?
Traceback (most recent call last):
File "/base/data/home/apps/s~culturemap-bulkmail/1.368407357562484358/bulkmail/views.py", line 83, in mailer
emailer.send(email, context)
File "/base/data/home/apps/s~culturemap-bulkmail/1.368407357562484358/bulkmail/mailers/amazon.py", line 91, in send
self.connection.send(email, msg.message().as_string())
File "/base/data/home/apps/s~culturemap-bulkmail/1.368407357562484358/bulkmail/mailers/amazon.py", line 49, in send
headers=self.headers,
File "/python27_runtime/python27_lib/versions/1/google/appengine/api/urlfetch.py", line 339, in make_fetch_call
rpc.make_call('Fetch', request, response, _get_fetch_result, allow_truncated)
File "/python27_runtime/python27_lib/versions/1/google/appengine/api/apiproxy_stub_map.py", line 519, in make_call
assert self.__rpc.state == apiproxy_rpc.RPC.IDLE, repr(self.state)
AssertionError: 2
在 init :中
self.fetcher = urlfetch.create_rpc(deadline=60)
在多次调用的方法中: 也排除错误:
fetch = urlfetch.make_fetch_call(
self.fetcher,
'https://email.us-east-1.amazonaws.com/',
payload=form_data,
method=urlfetch.POST,
headers=self.headers,
)
我想我应该创建一个新的rpc而不是重用它?
答案 0 :(得分:1)
显示一些代码,从错误中看起来您正在重用现有的活动RPC对象。