2013-06-28 62 views
0

當使用異步URL抓取時,我得到像這樣的間歇性錯誤:URL抓取斷言錯誤:2

對於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 

初始化:在方法

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代替重用它?

回答

1

顯示您的一些代碼,從錯誤中看出您正在重用現有的活動RPC對象。

+0

確定使用我的代碼更新了。我想你的權利,我沒有注意到在例子中總是創建一個新的RPC。 – PizzaPanther