Task recovery

Scheduled tasks can retry upon failure by using the recovery section with the task definition. By default, if recovery is not defined, it is turned off. If you want a scheduled task to be retried upon failure, the task needs to have a recovery section that is defined within its task definition.

The following example is an example of a recovery section for a task definition.
<RECOVERY retryOnError="true">
   <RETRYINTERVAL>15 mins</RETRYINTERVAL>
   <EXPIRY>1 hour</EXPIRY>
</RECOVERY>

Using the provided example, if a scheduled task fails during its initial run, the task automatically tries to run again in 15 minutes. This retry process continues every 15 minutes for a maximum of 1 hour from the time the task failed initially or until the task completes successfully.

Each element in the recovery section is optional and is assigned a default value.
Table 1. Recovery section default values
Parameter Description Default
RECOVERY Recovery element for holding the recovery details. If this element is not specified, recovery is turned off for the task. No recovery
retryOnError Attribute for turning on recovery. If this attribute is not specified or has a value of false, recovery for the task is turned off and all other recovery parameters are ignored. False
RETRYINTERVAL If the retryOnError parameter is set to true, the task uses the value that is found in RETRYINTERVAL to calculate the next time that the task runs. The calculation for the next time is current time of failure + RETRYINTERVAL.

For example, if a task fails at noon and the RETRYINTERVAL is set for 15 minutes, the task next runs at 12:15 PM. If the RETRYINTERVAL is not specified and retryOnError is set to true, the default value is used and the task runs every 5 minutes.

5 minutes
EXPIRY This parameter identifies when a task expires and no longer runs. The calculated date and time for the expiration is based on when the task first fails.

For example, if a task fails for the first time at noon, the expiration for this task is calculated to be 1:00 PM. At 1:00 PM, the task expires and no longer tries to run. If the EXPIRY parameter is not specified, the default value of 1 hour is used.

1 hour