App Engine:失败的任务队列的默认重试参数是什么

时间:2015-09-02 03:49:27

标签: google-app-engine default task-queue

Google App Engine具有强大的设置参数,可自动重试分布式任务队列中的失败任务。在documentation explains what these parameters do时,它无法指定默认参数。

Taskqueue的重试参数有哪些默认值。更具体地说,以下重试参数的默认值是什么:

  • <configSections> <section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" /> </configSections>
  • task_retry_limit
  • task_age_limit
  • min_backoff_seconds
  • max_backoff_seconds

1 个答案:

答案 0 :(得分:1)

默认行为在this section的开头描述:

  

任务队列中执行的任务可能由于多种原因而失败。如果一个任务   无法执行(通过返回任何HTTP状态代码   范围200-299),App Engine重试任务直到成功。通过   默认情况下,系统会逐渐降低重试率以避免泛滥   您的应用程序请求太多,但计划重试尝试   每小时最多重复一次,直到任务成功。

从这个描述中,通过观察没有重试配置的推送队列中的实际失败任务的日志(因此使用所有这些参数的默认值),我“导出”了这些值:

  • task_retry_limit:无
  • task_age_limit:无
  • min_backoff_seconds:0.1
  • max_backoff_seconds:3600
  • max_doublings:无

这些是我在开发服务器上看到的一些日志 - 我没有等待重试间隔安定下来,所以:

INFO     2015-09-02 12:50:54,670 module.py:808] my_module: "POST /my/task_q/path HTTP/1.1" 403 55
WARNING  2015-09-02 12:50:54,670 taskqueue_stub.py:1977] Task task2 failed to execute. This task will retry in 0.100 seconds
INFO     2015-09-02 12:50:54,774 module.py:808] my_module: "POST /my/task_q/path HTTP/1.1" 403 55
WARNING  2015-09-02 12:50:54,774 taskqueue_stub.py:1977] Task task2 failed to execute. This task will retry in 0.200 seconds
INFO     2015-09-02 12:50:54,983 module.py:808] my_module: "POST /my/task_q/path HTTP/1.1" 403 55
WARNING  2015-09-02 12:50:54,983 taskqueue_stub.py:1977] Task task2 failed to execute. This task will retry in 0.400 seconds
INFO     2015-09-02 12:50:55,394 module.py:808] my_module: "POST /my/task_q/path HTTP/1.1" 403 55
WARNING  2015-09-02 12:50:55,394 taskqueue_stub.py:1977] Task task2 failed to execute. This task will retry in 0.800 seconds
INFO     2015-09-02 12:50:56,206 module.py:808] my_module: "POST /my/task_q/path HTTP/1.1" 403 55
WARNING  2015-09-02 12:50:56,206 taskqueue_stub.py:1977] Task task2 failed to execute. This task will retry in 1.600 seconds
INFO     2015-09-02 12:50:57,815 module.py:808] my_module: "POST /my/task_q/path HTTP/1.1" 403 55
WARNING  2015-09-02 12:50:57,815 taskqueue_stub.py:1977] Task task2 failed to execute. This task will retry in 3.200 seconds
INFO     2015-09-02 12:51:01,058 module.py:808] my_module: "POST /my/task_q/path HTTP/1.1" 403 55
WARNING  2015-09-02 12:51:01,058 taskqueue_stub.py:1977] Task task2 failed to execute. This task will retry in 6.400 seconds
INFO     2015-09-02 12:51:07,507 module.py:808] my_module: "POST /my/task_q/path HTTP/1.1" 403 55
WARNING  2015-09-02 12:51:07,507 taskqueue_stub.py:1977] Task task2 failed to execute. This task will retry in 12.800 seconds
INFO     2015-09-02 12:51:20,346 module.py:808] my_module: "POST /my/task_q/path HTTP/1.1" 403 55
WARNING  2015-09-02 12:51:20,346 taskqueue_stub.py:1977] Task task2 failed to execute. This task will retry in 25.600 seconds
INFO     2015-09-02 12:51:45,988 module.py:808] my_module: "POST /my/task_q/path HTTP/1.1" 403 55
WARNING  2015-09-02 12:51:45,989 taskqueue_stub.py:1977] Task task2 failed to execute. This task will retry in 51.200 seconds
INFO     2015-09-02 12:52:37,224 module.py:808] my_module: "POST /my/task_q/path HTTP/1.1" 403 55
WARNING  2015-09-02 12:52:37,225 taskqueue_stub.py:1977] Task task2 failed to execute. This task will retry in 102.400 seconds
INFO     2015-09-02 12:54:19,668 module.py:808] my_module: "POST /my/task_q/path HTTP/1.1" 403 55
WARNING  2015-09-02 12:54:19,668 taskqueue_stub.py:1977] Task task2 failed to execute. This task will retry in 204.800 seconds
INFO     2015-09-02 12:57:44,508 module.py:808] my_module: "POST /my/task_q/path HTTP/1.1" 403 55
WARNING  2015-09-02 12:57:44,509 taskqueue_stub.py:1977] Task task2 failed to execute. This task will retry in 409.600 seconds

编辑:其实我找到了一个更好的答案,我曾经纠正过我(我以前错过了其他人之间的0.100s日志条目):What are the defaults for a task queue in AppEngine?