GOOGLE-PROFESSIONAL-CLOUD-DEVELOPER practice question 10 of 35
You support an application that uses the Cloud Storage API. You review the logs and discover multiple HTTP 503 Service Unavailable error responses from the API. Your application logs the error and does not take any further action. You want to implement Google-recommended retry logic to improve success rates. Which approach should you take?
Full set: 265 questionsThe HTTP 503 Service Unavailable error indicates a transient server-side issue, meaning the request may succeed if retried later. The Google-recommended best practice for handling such errors is to implement a retry strategy with truncated exponential backoff. This approach involves retrying the failed request after a delay, with the delay increasing exponentially after each subsequent failure, up to a maximum backoff time and a maximum number of retries. This method prevents clients from overwhelming an already struggling service with rapid, repeated requests, giving it time to recover and increasing the probability of a successful subsequent attempt.
A. Retrying in batches is inefficient and can create a "thundering herd" problem, further overwhelming the service when the batch is processed.
B. Retrying at a fixed interval can lead to synchronized retries from multiple clients, which does not alleviate the load on the service effectively.
D. Decreasing the time interval between retries is an anti-pattern that would increase the request rate and worsen the load on an already unavailable service.
1. Google Cloud Storage Documentation, Best Practices, "Retry strategy": "For any request to Cloud Storage that fails with a retryable error code, we recommend using a retry strategy. ... We recommend using truncated exponential backoff for retries of 5xx errors...". This section explicitly recommends exponential backoff for 5xx errors, which includes 503 Service Unavailable.
2. Google Cloud API Design Guide, "Error Handling": Under the section for google.rpc.Code.UNAVAILABLE (which maps to HTTP 503), the guide states: "The client should retry with an exponential backoff. The minimum backoff should be 1s unless otherwise documented." This establishes exponential backoff as the standard, recommended client behavior for this error across Google Cloud APIs.
3. Google Cloud Architecture Framework, "Design for reliability", "Implement retries with exponential backoff": "Transient failures can be caused by temporary issues, such as network congestion or server overload. To handle these failures, implement retries with exponential backoff. This technique involves retrying a failed request with progressively longer delays between retries." This document reinforces the principle as a core reliability practice within the Google Cloud ecosystem.
Keep practicing
Take the free GOOGLE-PROFESSIONAL-CLOUD-DEVELOPER practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other GOOGLE-PROFESSIONAL-CLOUD-DEVELOPER practice questions
- Question 1You have an application controlled by a managed instance group. When you deploy a new ver…
- Question 2Your service adds text to images that it reads from Cloud Storage. During busy times of t…
- Question 3You have been tasked with planning the migration of your company’s application from on-pr…
- Question 4You plan to make a simple HTML application available on the internet. This site keeps inf…
- Question 5HipLocal's APIs are showing occasional failures, but they cannot find a pattern. They wan…
- Question 6Your company has created an application that uploads a report to a Cloud Storage bucket. …
