AppEngine'明确取消'错误

时间:2010-02-12 00:24:15

标签: python google-app-engine scheduled-tasks google-cloud-datastore

我正在使用Google AppEngine和带有Mapper类的延迟库,如here所述(在here中有一些改进)。在映射器的一些迭代中,我得到以下错误:

CancelledError: The API call datastore_v3.Put() was explicitly cancelled.

Mapper通常运行正常,我曾经有更高的批量大小,所以实际上它会点击DeadlineExceededError,并且处理得当。

为了确定,我将batch_size减少到一个非常低的数字,因此它甚至没有达到DeadlineExceededError但我仍然得到CancelledError

堆栈跟踪如下:

File "utils.py", line 114, in _continue
  self._batch_write()
File "utils.py", line 76, in _batch_write
  db.put(self.to_put)
File "/google/appengine/ext/db/__init__.py", line 1238, in put
  keys = datastore.Put(entities, rpc=rpc)
File "/google/appengine/api/datastore.py", line 255, in Put
  'datastore_v3', 'Put', req, datastore_pb.PutResponse(), rpc)
File "/google/appengine/api/datastore.py", line 177, in _MakeSyncCall
  rpc.check_success()
File "/google/appengine/api/apiproxy_stub_map.py", line 474, in check_success
  self.__rpc.CheckSuccess()
File "/google/appengine/api/apiproxy_rpc.py", line 126, in CheckSuccess
  raise self.exception
CancelledError: The API call datastore_v3.Put() was explicitly cancelled.

我无法真正找到有关此“明确取消”错误的大量信息,因此我想知道是什么导致了这一问题以及如何进行调查。

1 个答案:

答案 0 :(得分:1)

DeadlineExceededError之后,您可以获得一小段宽限时间来处理异常,例如推迟计算的其余部分。

如果你的恩典时间不够,CancelledError就会开始。

应该无法捕获/处理CancelledError

相关问题