By default, if a Cloud Scheduler job doesn't receive an acknowledgement from its handler, the job is considered to have failed, and will retry according to the exponential backoff you have configured. You can determine this retry behavior in the following ways when creating or updating a Cloud Scheduler job:
Making a direct API request and configuring the
RetryConfig
settings of aJob
resource
Retry settings
The following tables describe the retry settings that you can configure.
Maximum retry attempts
The number of attempts that the system will make to run a job using the
exponential backoff procedure described by maxDoublings
.
Description | If If Values greater than 5 and negative values are not allowed. |
Default | Default is 0. |
Console label | Max retry attempts |
CLI flag | --max-retry-attempts |
API field | retryCount |
Maximum retry duration
The time limit for retrying a failed job, measured from the time when an
execution was first attempted. If specified with retryCount
, the job will be
retried until both limits are reached.
Description | A duration in seconds with up to nine fractional digits, ending with "s"—for example, "3.5s". A duration of 0 means that the retry duration is unlimited. However, if
|
Default | Default is 0 seconds. |
Console label | Max retry duration |
CLI flag | --max-retry-duration |
API field | maxRetryDuration |
Minimum backoff duration
The minimum amount of time to wait before retrying a job after it fails.
Description | A duration in seconds with up to nine fractional digits, ending with "s"—for example, "3.5s". |
Default | Default is 5 seconds. |
Console label | Min backoff duration |
CLI flag | --min-backoff |
API field | minBackoffDuration |
Maximum backoff duration
The maximum amount of time to wait before retrying a job after it fails.
Description | A duration in seconds with up to nine fractional digits, ending with "s"—for example, "3.5s". |
Default | Default is 3600 seconds (1 hour). |
Console label | Max backoff duration |
CLI flag | --max-backoff |
API field | maxBackoffDuration |
Maximum doublings
Maximum number of times that the interval between failed job retries will be doubled before the increase becomes constant.
Description | The time between retries will double maxDoublings times.
A job's retry interval starts at If
Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s. If
Thus, the requests will retry at 10s, 20s, 40s, 120s, 120s. |
Default | Default is 5. |
Console label | Max doublings |
CLI flag | --max-doublings |
API field | maxDoublings |
Retry examples
The following examples demonstrate the retry behavior when a Cloud Scheduler job doesn't complete successfully.
- If both
retryCount
andmaxRetryDuration
are not set Both settings default to 0 and the job doesn't retry at all.
Note that Cloud Scheduler will try to run the job at the next scheduled execution time.
- If both
retryCount
andmaxRetryDuration
are set The job will retry at least
retryCount
number of times until reachingmaxRetryDuration
.Note that the job could retry more times than the
retryCount
.- If
retryCount
is set andmaxRetryDuration
is not set The
maxRetryDuration
setting defaults to 0 and the job will retry exactlyretryCount
number of times.- If
retryCount
is not set andmaxRetryDuration
is set The job will retry any number of times (up to a maximum of 5 times) or until reaching
maxRetryDuration
.