The timeout setting in Pipelines is the maximum time after which pipeline steps will timeout. If the step does not complete in the given time limit, it is forced to completion with a timed out status.
Setting a timeout is useful for steps that are expected to run for a shorter duration. For example, in a pipeline, Step A is expected to run for only 3 minutes, but Step B and Step C are expected to run for 45 minutes. In this case, setting the timeout for Step A to around five minutes ensures that even if the step gets trapped in a retry loop, the other, non-dependent steps, can execute after the timeout.
Timeouts can be set at the following levels and are applied according to a preset order of precedence:
Extending our example further:
Step A and Step B are configured to run on Node Pool A, and Step C is configured on run on Node Pool B
Node Pool A has its timeout set to 3600 seconds (60 minutes)
Node Pool B has no timeout set
Step A has its timeout value set to 300 seconds (5 minutes) in the pipelines yaml
Step B and Step C have no timeout set in the pipelines yaml
The timeout in the system yaml is set to 7200000 milliseconds (120 minutes)
Now, when the pipeline runs:
Step A has 5 minutes before timing out. Due to the order of precedence, it ignores the timeout set for Node Pool A and the system yaml, both of which have higher timeout values.
Step B has 60 minutes before timing out, since that is the value set for Node Pool A. It ignores the value set in the system yaml.
Step C has 120 minutes before timing out, since that is the value set in the system yaml.
Timeout at Step-level
Step-level timeout setting takes precedence over every other timeout setting, be it at node pool-level or system-level. If this value is not set, the step uses the timeout setting configured for the node pool in the UI.
Note
The step-level timeout cannot exceed the timeout set for system or node pool.
The timeout at step-level can be set for any step using thetimeoutSeconds
property, which is added to the Configuration section of the step. For more information, see Step Configuration.
In this example, the timeout is set to 300 seconds (5 minutes):
Example
pipelines: - name: my_pipeline steps: - name: my_step type: Bash configuration: timeoutSeconds: 300 //5 minutes execution: onExecute: - echo "This is my step."
Timeout at Node Pool-level
Node pool-level timeout is used when one or more steps in your pipeline do not have any timeout specified at the step-level. Each node pool can have a different step timeout duration. Default value is 3600 seconds.
The timeout at node pool-level can be set in the UI. For more information, see Managing Pipelines Node Pools.
Note
Node pool-level timeout cannot be greater than the value set for stepTimeoutMS
in the Pipelines System YAML.
Timeout at System-level
System-level timeout is enabled and set to 3600000 milliseconds (60 minutes) by default. This can be set using the stepTimeoutMS
property in the Runtime Configuration section in Pipelines System YAML:
stepTimeoutMS: 3600000
System-level timeout can be changed to any duration of your choice.