Go 1.11 ha raggiunto la fine del supporto
e verrà ritirato
il 31 gennaio 2026. Dopo il ritiro, non potrai eseguire il deployment delle applicazioni Go 1.11, anche se la tua organizzazione ha utilizzato in precedenza un criterio dell'organizzazione per riattivare i deployment dei runtime legacy. Le tue applicazioni Go
1.11 continueranno a essere eseguite e a ricevere traffico dopo la
data di ritiro. Ti
consigliamo di eseguire la migrazione all'ultima versione supportata di Go.
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Le attività push in fase di elaborazione tramite una coda di attività possono non riuscire per diversi motivi. Se un gestore non riesce a eseguire un'attività (e quindi restituisce un codice di stato HTTP esterno all'intervallo 200-299), App Engine riprova fino a quando l'attività non va a buon fine.
Per impostazione predefinita, il sistema riduce gradualmente la frequenza di ripetizione per evitare di sovraccaricare l'applicazione con troppe richieste, ma pianifica i tentativi di ripetizione in modo che si ripetano al massimo una volta all'ora fino a quando l'attività non va a buon fine.
Riprovare le attività
Puoi personalizzare il tuo schema per le ripetizioni delle attività aggiungendo l'elemento retry
parameters in queue.yaml. Questa aggiunta consente di specificare il numero massimo di volte per riprovare le attività non riuscite in una coda specifica. Puoi anche impostare un limite di tempo per i tentativi di ripetizione e controllare l'intervallo tra i tentativi.
L'esempio seguente mostra vari scenari di ripetizione:
In fooqueue, i tentativi di esecuzione delle attività vengono ripetuti fino a sette volte e per un massimo di due giorni dal primo tentativo di esecuzione. Dopo aver superato entrambi i limiti, l'operazione non va a buon fine
in modo definitivo.
In barqueue, App Engine tenta di ripetere le attività, aumentando in modo lineare l'intervallo tra ogni nuovo tentativo fino a raggiungere il backoff massimo e riprovando indefinitamente all'intervallo massimo (quindi gli intervalli tra le richieste sono 10 secondi, 20 secondi, 30 secondi, ..., 190 secondi, 200 secondi, 200 secondi e così via).
In bazqueue, l'intervallo tra i tentativi inizia a 10 secondi, poi raddoppia tre volte,
poi aumenta in modo lineare e infine esegue tentativi indefiniti all'intervallo
massimo (quindi gli intervalli tra le richieste sono
10 secondi, 20 secondi, 40 secondi, 80 secondi, 160 secondi, 240 secondi, 300 secondi, 300 secondi e così via).
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-04 UTC."],[[["\u003cp\u003eApp Engine automatically retries tasks that fail, meaning any HTTP status code outside of 200-299, with a gradually decreasing retry rate, up to a maximum of once per hour.\u003c/p\u003e\n"],["\u003cp\u003eRetry settings can be configured for individual queues or specified within the \u003ccode\u003eTask\u003c/code\u003e type, with the latter taking precedence when both are defined.\u003c/p\u003e\n"],["\u003cp\u003eCustom retry schemes can be set up in \u003ccode\u003equeue.yaml\u003c/code\u003e, allowing control over the maximum number of retries and the time limit for retry attempts, as well as the interval between them.\u003c/p\u003e\n"],["\u003cp\u003eDifferent retry behaviors, such as a fixed number of retries, linearly increasing retry intervals, or exponentially increasing intervals followed by a linear increase and then indefinite retries, can be defined.\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| go\n| /services/access). If you are updating to the App Engine Go 1.12+ runtime, refer to the [migration guide](/appengine/migration-center/standard/migrate-to-second-gen/go-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 [`Task`](/appengine/docs/legacy/standard/go111/taskqueue/reference#RetryOptions) type. 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/go111/config/queueref#retry_parameters)\nelement in [`queue.yaml`](/appengine/docs/legacy/standard/go111/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 queue:\n - name: fooqueue\n rate: 1/s\n retry_parameters:\n task_retry_limit: 7\n task_age_limit: 2d\n - name: barqueue\n rate: 1/s\n retry_parameters:\n min_backoff_seconds: 10\n max_backoff_seconds: 200\n max_doublings: 0\n - name: bazqueue\n rate: 1/s\n retry_parameters:\n min_backoff_seconds: 10\n max_backoff_seconds: 300\n max_doublings: 3\n\nWhat's next\n-----------\n\n- Learn more about the [task queue parameters](/appengine/docs/legacy/standard/go111/config/queueref)."]]