Maven / GitLab CI Basics Interview Questions
What is the 'timeout' keyword in GitLab CI and what are the defaults?
The timeout keyword sets the maximum duration a job is allowed to run before GitLab forcefully stops it. Timeouts prevent hanging jobs from blocking runners and consuming resources indefinitely.
# Job-level timeout long-running-test: script: - run-full-integration-tests.sh timeout: 2 hours # stop after 2 hours build-job: script: - make build timeout: 30 minutes # stop after 30 minutes # Timeout format examples: # timeout: 3600 (seconds) # timeout: 60 minutes # timeout: 2 hours # timeout: 1h 30m # timeout: 1 day # Default timeout hierarchy: # 1. Job-level timeout (if set) # 2. Project-level timeout (Settings > CI/CD > General pipelines) # 3. Runner timeout (set when runner is registered) # The smallest of project timeout and runner timeout applies, # then job-level timeout can only be lower than that
| Level | Where set | Default |
|---|---|---|
| Job | timeout: keyword in job | No default (uses project or runner) |
| Project | Settings > CI/CD > General pipelines | 60 minutes |
| Runner | Registered runner config | No limit (unlimited) |
Key rule: a job timeout cannot exceed the project-level timeout or the runner's maximum timeout. If you set a job timeout longer than the project timeout, the project timeout wins.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
