Appengine Runs Failed Tasks Twice Even If Task_retry_limit=0
I'm seeing a buggy behaviour in taskqueue API. When a task fails, appengine always runs it once again, even if I tell it not to. This is the relevant code: NO_RETRY = TaskRetryOpti
Solution 1:
As mentioned in the documentation App Engine will sometimes run a task twice. You should write your tasks to ensure that this will not be harmful.
Solution 2:
I just found a way to avoid the undesired retry:
taskqueue.add(
url='/blah',
queue_name='myq',
retry_options=TaskRetryOptions(task_retry_limit=0, task_age_limit=1),
countdown=1,
)
This combination of of retry_limit, age_limit and countdown is the magical incantation that does the trick.
It's still suboptimal though, so I'll leave this without a green answer until google fixes this bug.
Solution 3:
Check your queue.yaml file and make sure it is correctly configured.
queue:-name:defaultretry_parameters:task_retry_limit:0
Post a Comment for "Appengine Runs Failed Tasks Twice Even If Task_retry_limit=0"