Ensure that each Cloud Tasks queue has a compliant retry policy to limit the number of retries for failed tasks, preventing infinite loops or excessive downstream service invocations. A retry policy is considered compliant if the "maxAttempts" parameter (i.e., the maximum number of attempts per task in the queue) is set to a value other than -1 (unlimited attempts).
efficiency
Ensuring a retry policy is configured for Cloud Tasks queues is important to control how and when failed tasks are retried. This prevents infinite retries, protects downstream services from excessive requests, and allows for efficient error handling by defining limits, delays, and strategies for retrying failed tasks.
Audit
To determine if a retry policy is configured for your Google Cloud Tasks queues, perform the following operations:
Remediation / Resolution
To ensure that each Cloud Tasks queue within your GCP project has a compliant retry policy limiting the number of retries for failed tasks, perform the following operations:
References
- Google Cloud Platform (GCP) Documentation
- Understand Cloud Tasks
- Configure Cloud Tasks queues
- GCP Command Line Interface (CLI) Documentation
- gcloud projects list
- gcloud tasks queues list
- gcloud tasks queues describe
- gcloud tasks queues update