首页 > 解决方案 > GCP 任务队列死锁或线程问题

问题描述

我正在尝试在 GAE 标准(本地主机)上测试一些异步逻辑,并且在我杀死服务器之前出现了死锁,然后我看到了这个堆栈跟踪。

所有反馈表示赞赏!

INFO     2019-03-25 22:47:22,304 module.py:861] task: "POST /community/news/forge HTTP/1.1" 500 -
WARNING  2019-03-25 22:47:22,304 taskqueue_stub.py:2149] Task task2 failed to execute. This task will retry in 0.100 seconds
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/Users/dgaedcke/gcloud_tools/google-cloud-sdk/platform/google_appengine/google/appengine/api/taskqueue/taskqueue_stub.py", line 2182, in MainLoop
    self._ProcessQueues()
  File "/Users/dgaedcke/gcloud_tools/google-cloud-sdk/platform/google_appengine/google/appengine/api/taskqueue/taskqueue_stub.py", line 2127, in _ProcessQueues
    response_code = self.task_executor.ExecuteTask(task, queue)
  File "/Users/dgaedcke/gcloud_tools/google-cloud-sdk/platform/google_appengine/google/appengine/api/taskqueue/taskqueue_stub.py", line 2059, in ExecuteTask
    '0.1.0.2')
  File "/Users/dgaedcke/gcloud_tools/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/dispatcher.py", line 757, in add_request
    inst)
  File "/Users/dgaedcke/gcloud_tools/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/dispatcher.py", line 843, in _handle_request
    request_type=request_type)
  File "/Users/dgaedcke/gcloud_tools/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/module.py", line 820, in _handle_request
    logservice = apiproxy_stub_map.apiproxy.GetStub('logservice')
AttributeError: 'module' object has no attribute 'apiproxy'

标签: pythongoogle-cloud-platformtask-queuegoogle-app-engine-python

解决方案


推荐阅读