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
RetryConfigsettings of aJobresource 
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.
maxDoublings 
times. A job's retry interval starts at minBackoffDuration 
, then
    doubles maxDoublings 
times, then increases linearly, and
    finally retries at intervals of maxBackoffDuration 
up to retryCount 
times. For example:
If minBackoffDuration 
is 10s, maxBackoffDuration 
is 300s, and maxDoublings 
is 3:
- The job will first be retried in 10s.
 - The retry interval will double three times.
 - The retry interval will then increase linearly by 2^3 * 10s.
 - If applicable, the job will retry at intervals of 
maxBackoffDurationuntil the job has been attemptedretryCounttimes (to a maximum of 5 times). 
Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s.
If minBackoffDuration 
is 10s, maxBackoffDuration 
is 120s, and maxDoublings 
is 2:
- The job will first be retried in 10s.
 - The retry interval will double two times.
 - The retry interval will then increase linearly by 2^3 * 10s.
 - If applicable, the job will retry at intervals of 
maxBackoffDurationuntil the job has been attemptedretryCounttimes (to a maximum of 5 times). 
Thus, the requests will retry at 10s, 20s, 40s, 120s, 120s.
--max-doublings 
maxDoublings 
Retry examples
The following examples demonstrate the retry behavior when a Cloud Scheduler job doesn't complete successfully.
- If both 
retryCountandmaxRetryDurationare 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 
retryCountandmaxRetryDurationare set -  
The job will retry at least
retryCountnumber of times until reachingmaxRetryDuration.Note that the job could retry more times than the
retryCount. - If 
retryCountis set andmaxRetryDurationis not set -  
The
maxRetryDurationsetting defaults to 0 and the job will retry exactlyretryCountnumber of times. - If 
retryCountis not set andmaxRetryDurationis set -  
The job will retry any number of times (up to a maximum of 5 times) or until reaching
maxRetryDuration. 

