Retrying Failed Push Tasks Stay organized with collections Save and categorize content based on your preferences.
Push tasks being processed via a task queue can fail for many reasons. If a handlerfails to execute a task (and therefore returns any HTTP status code outside ofthe range 200–299), App Engine retries the task until it succeeds.
By default, the system gradually reduces the retry rate to avoid overloading your application with too manyrequests, but schedules retry attempts to recur at a maximum of once per houruntil the task succeeds.
Retrying tasks
You can customize your own scheme for task retries byadding theretryparameterselement in. Thisaddition allows you to specify the maximum number of times to retry failed tasksin a specific queue. You can also set a time limit for retry attempts andcontrol the interval between attempts.queue.yaml
The following example demonstrates various retry scenarios:
- In
fooqueue, tasks are retried up to seven times and for up to two daysfrom the first execution attempt. After both limits are passed, it failspermanently. - In
barqueue, App Engine attempts to retry tasks, increasing the intervallinearly between each retry until reaching the maximum backoff and retryingindefinitely at the maximum interval (so the intervals between requests are10s, 20s, 30s, ..., 190s, 200s, 200s, ...). - In
bazqueue, the retry interval starts at 10s, then doubles three times,then increases linearly, and finally retries indefinitely at themaximum interval (so the intervals between requests are10s, 20s, 40s, 80s, 160s, 240s, 300s, 300s, ...).
<?xml version="1.0" encoding="utf-8"?> <queue-entries> <queue> <name>fooqueue</name> <rate>1/s</rate> <retry-parameters> <task-retry-limit>7</task-retry-limit> <task-age-limit>2d</task-age-limit> </retry-parameters> </queue> <queue> <name>barqueue</name> <rate>1/s</rate> <retry-parameters> <min-backoff-seconds>10</min-backoff-seconds> <max-backoff-seconds>200</max-backoff-seconds> <max-doublings>0</max-doublings> </retry-parameters> </queue> <queue> <name>bazqueue</name> <rate>1/s</rate> <retry-parameters> <min-backoff-seconds>10</min-backoff-seconds> <max-backoff-seconds>300</max-backoff-seconds> <max-doublings>3</max-doublings> </retry-parameters> </queue> </queue-entries>What's next
- Learn more about thetask queue parameters.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-15 UTC.