nerdexam
Google

PROFESSIONAL-CLOUD-DEVELOPER · Question #177

You are using the Cloud Client Library to upload an image in your application to Cloud Storage. Users of the application report that occasionally the upload does not complete and the client library re

The correct answer is A. Write an exponential backoff process around the client library call.. Exponential backoff is the industry-standard and Google-recommended strategy for handling transient errors like HTTP 504 Gateway Timeout. With exponential backoff, each retry waits progressively longer (e.g., 1s, 2s, 4s, 8s...), which reduces load on the server and avoids thunder

Implementing Application Resilience and Error Handling

Question

You are using the Cloud Client Library to upload an image in your application to Cloud Storage. Users of the application report that occasionally the upload does not complete and the client library reports an HTTP 504 Gateway Timeout error. You want to make the application more resilient to errors. What changes to the application should you make?

Options

  • AWrite an exponential backoff process around the client library call.
  • BWrite a one-second wait time backoff process around the client library call.
  • CDesign a retry button in the application and ask users to click if the error occurs.
  • DCreate a queue for the object and inform the users that the application will try again in 10

How the community answered

(48 responses)
  • A
    83% (40)
  • B
    2% (1)
  • C
    10% (5)
  • D
    4% (2)

Explanation

Exponential backoff is the industry-standard and Google-recommended strategy for handling transient errors like HTTP 504 Gateway Timeout. With exponential backoff, each retry waits progressively longer (e.g., 1s, 2s, 4s, 8s...), which reduces load on the server and avoids thundering herd problems. A fixed one-second wait (B) does not reduce server pressure and can cause retry storms. Asking users to manually click retry (C) is poor UX and unreliable. Creating a queue with a 10-minute retry delay (D) is overly complex and introduces unnecessary latency for a transient network error. The Cloud Client Libraries support exponential backoff as a built-in pattern.

Topics

#Error Handling#Application Resilience#Exponential Backoff#Cloud Storage

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-CLOUD-DEVELOPER Practice