professional-cloud-data-engineer
Prepare and test your skills
Prepare and test your skills
Worked example. The correct answer is already marked and every option is explained below, so there is nothing to select here. To answer questions yourself, start the free trial.
Keep the momentum going with these hand-picked practice scenarios
Want more questions like this?
Get a free certification question every week.
Last updated
An organization runs an hourly batch data pipeline orchestrated by Cloud Scheduler that invokes an HTTP endpoint hosted on Cloud Run. The service ingests transaction data and writes the processed records into BigQuery.
Due to transient network interruptions, the HTTP target occasionally receives duplicate invocations for a single scheduled run. Furthermore, long-running job attempts sometimes cause Cloud Scheduler to mark an attempt as failed even though the Cloud Run container is still processing the request, blocking subsequent hourly executions.
You need to ensure idempotent execution across retry attempts and resolve the job execution timeout mismatch.
What should you do?
Query Cloud Logging from the Cloud Run container for AttemptStarted log entries to detect duplicate executions, and increase maxRetryDuration in Cloud Scheduler.
Generate a unique UUID inside the Cloud Scheduler request payload body and disable retries by setting retryCount to 0, while increasing Cloud Run's concurrency limit.
Configure Cloud Scheduler to use the standard HTTP Date header for deduplication, and adjust the maxDoublings setting to reduce retry intervals.
Extract the job name and the X-CloudScheduler-ScheduleTime header in the Cloud Run handler to implement request deduplication, and configure the attempt_deadline field in Cloud Scheduler to align with the container timeout.
Query Cloud Logging from the Cloud Run container for AttemptStarted log entries to detect duplicate executions, and increase maxRetryDuration in Cloud Scheduler.
Generate a unique UUID inside the Cloud Scheduler request payload body and disable retries by setting retryCount to 0, while increasing Cloud Run's concurrency limit.
Configure Cloud Scheduler to use the standard HTTP Date header for deduplication, and adjust the maxDoublings setting to reduce retry intervals.
Extract the job name and the X-CloudScheduler-ScheduleTime header in the Cloud Run handler to implement request deduplication, and configure the attempt_deadline field in Cloud Scheduler to align with the container timeout.
This solution uses Cloud Scheduler's built-in execution metadata headers to enforce idempotent request handling while tuning the attempt_deadline setting to align Cloud Scheduler's client timeout with the Cloud Run service timeout.
X-CloudScheduler-ScheduleTime header to HTTP requests. This header represents the original scheduled invocation timestamp and remains constant across all automated retry attempts for that specific scheduled interval. Combining the job name with X-CloudScheduler-ScheduleTime produces a deterministic deduplication key, allowing the Cloud Run handler to check if a specific schedule interval has already been processed or is currently executing.attempt_deadline field in Cloud Scheduler ensures Cloud Scheduler waits sufficiently for Cloud Run to respond before timing out the attempt. If attempt_deadline is shorter than the workload processing time, Cloud Scheduler treats the call as failed, initiates retries, or keeps the execution state in AttemptStarted without receiving an AttemptFinished response, which skips subsequent scheduled runs.Cloud Scheduler provides "at-least-once" delivery semantics. Leveraging X-CloudScheduler-ScheduleTime is the standard native mechanism for deduplication because Cloud Scheduler populates this value deterministically for every attempt of a given schedule instance, unlike generic HTTP headers.