Timeout Strategy
About 296 wordsLess than 1 minute
Timeout Strategy describes the execution limits for pipelines and jobs; they are terminated automatically once exceeded.
When to use: when diagnosing why a job was terminated, or when sizing build duration limits — for example raising the timeout for a long-running job, releasing resources earlier for a stuck job, or checking the default no-output timeout.
Pipeline Timeout
The maximum execution time for a pipeline is 20 hours. After 20 hours, the pipeline container will be automatically destroyed.
Job Timeout
A job can customize its timeout by declaring timeout. If not declared, the following default values apply.
No Output Timeout
If a Job has no output for 10 minutes continuously, a timeout will be triggered. If timeout is declared, the no-output timeout matches the configured value.
Maximum Timeout Duration
A Job defaults to a maximum execution of 2 hours. If timeout is declared, that value is used instead, up to a maximum of 12 hours.
Configuration Example
The following example triggers a pipeline on the push event and sets the timeout of a job to 30 minutes:
main:
push:
- stages:
- name: build
image: node:20
script: |
npm install
npm run build
timeout: 30m # This job runs for at most 30 minutesAfter declaring timeout, this job:
- triggers a no-output timeout after 30 minutes of inactivity (replacing the default 10 minutes);
- runs for at most 30 minutes and then terminates automatically.
Tips
timeout supports units such as ms, s, m, and h. See grammar for more details.