[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[[["\u003cp\u003eApp Engine automatically retries failed push tasks until they succeed, with a default retry rate that gradually decreases to a maximum of once per hour to prevent overloading the application.\u003c/p\u003e\n"],["\u003cp\u003eRetry parameters can be customized either within the \u003ccode\u003equeue.xml\u003c/code\u003e file or directly on the \u003ccode\u003eQueue.add()\u003c/code\u003e method, with the latter taking precedence when both are specified.\u003c/p\u003e\n"],["\u003cp\u003eCustom retry schemes can define the maximum number of retries, the time limit for retries, and the intervals between retry attempts, as demonstrated through the \u003ccode\u003efooqueue\u003c/code\u003e, \u003ccode\u003ebarqueue\u003c/code\u003e, and \u003ccode\u003ebazqueue\u003c/code\u003e examples in the \u003ccode\u003equeue.xml\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eWhen configuring retries, parameters such as \u003ccode\u003emin-backoff-seconds\u003c/code\u003e, \u003ccode\u003emax-backoff-seconds\u003c/code\u003e, and \u003ccode\u003emax-doublings\u003c/code\u003e can be adjusted to define the retry behavior, including linear or exponential backoff strategies.\u003c/p\u003e\n"]]],[],null,["# Retrying Failed Push Tasks\n\nPush tasks being processed via a task queue can fail for many reasons. If a handler\nfails to execute a task (and therefore returns any HTTP status code outside of\nthe range 200--299), App Engine retries the task until it succeeds.\n| This API is supported for first-generation runtimes and can be used when [upgrading to corresponding second-generation runtimes](/appengine/docs/standard/\n| java-gen2\n|\n| /services/access). If you are updating to the App Engine Java 11/17 runtime, refer to the [migration guide](/appengine/migration-center/standard/migrate-to-second-gen/java-differences) to learn about your migration options for legacy bundled services.\n\nBy default, the system gradually reduces the retry rate to avoid overloading your application with too many\nrequests, but schedules retry attempts to recur at a maximum of once per hour\nuntil the task succeeds.\n\n| **Important:** Retry options can be configured for the queue as well specified on the [`Queue.add()`](/appengine/docs/legacy/standard/java/javadoc/com/google/appengine/api/taskqueue/RetryOptions) method. When both are specified, the **latter** takes precedence.\n\nRetrying tasks\n--------------\n\nYou can customize your own scheme for task retries by\nadding the [retry\nparameters](/appengine/docs/legacy/standard/java/config/queueref#retry_parameters)\nelement in [`queue.xml`](/appengine/docs/legacy/standard/java/config/queueref). This\naddition allows you to specify the maximum number of times to retry failed tasks\nin a specific queue. You can also set a time limit for retry attempts and\ncontrol the interval between attempts.\n\nThe following example demonstrates various retry scenarios:\n\n- In `fooqueue`, tasks are retried up to seven times and for up to two days from the first execution attempt. After both limits are passed, it fails permanently.\n- In `barqueue`, App Engine attempts to retry tasks, increasing the interval linearly between each retry until reaching the maximum backoff and retrying indefinitely at the maximum interval (so the intervals between requests are 10s, 20s, 30s, ..., 190s, 200s, 200s, ...).\n- In `bazqueue`, the retry interval starts at 10s, then doubles three times, then increases linearly, and finally retries indefinitely at the maximum interval (so the intervals between requests are 10s, 20s, 40s, 80s, 160s, 240s, 300s, 300s, ...).\n\n \u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n \u003cqueue-entries\u003e\n \u003cqueue\u003e\n \u003cname\u003efooqueue\u003c/name\u003e\n \u003crate\u003e1/s\u003c/rate\u003e\n \u003cretry-parameters\u003e\n \u003ctask-retry-limit\u003e7\u003c/task-retry-limit\u003e\n \u003ctask-age-limit\u003e2d\u003c/task-age-limit\u003e\n \u003c/retry-parameters\u003e\n \u003c/queue\u003e\n \u003cqueue\u003e\n \u003cname\u003ebarqueue\u003c/name\u003e\n \u003crate\u003e1/s\u003c/rate\u003e\n \u003cretry-parameters\u003e\n \u003cmin-backoff-seconds\u003e10\u003c/min-backoff-seconds\u003e\n \u003cmax-backoff-seconds\u003e200\u003c/max-backoff-seconds\u003e\n \u003cmax-doublings\u003e0\u003c/max-doublings\u003e\n \u003c/retry-parameters\u003e\n \u003c/queue\u003e\n \u003cqueue\u003e\n \u003cname\u003ebazqueue\u003c/name\u003e\n \u003crate\u003e1/s\u003c/rate\u003e\n \u003cretry-parameters\u003e\n \u003cmin-backoff-seconds\u003e10\u003c/min-backoff-seconds\u003e\n \u003cmax-backoff-seconds\u003e300\u003c/max-backoff-seconds\u003e\n \u003cmax-doublings\u003e3\u003c/max-doublings\u003e\n \u003c/retry-parameters\u003e\n \u003c/queue\u003e\n \u003c/queue-entries\u003e\n\nWhat's next\n-----------\n\n- Learn more about the [task queue parameters](/appengine/docs/legacy/standard/java/config/queueref)."]]