Interview Prep/GitHub Actions/Speed, Caching & Cost

A job sometimes hangs and burns 6 hours. How do you stop it happening again?

BeginnerScenarioSpeed, Caching & Cost
Answer

Situation read → Default 360-minute timeout.

What I'd do →

  1. Set timeout-minutes on every job based on p95 duration times 2 (for example 20).
  2. Add step-level timeouts on network steps and tool timeouts (kubectl rollout status --timeout=300s, curl --max-time 30).
  3. Add an actionlint or custom check that fails PRs adding jobs without timeout-minutes.

Why → A single hung job on a large runner can cost more than a week of normal CI.

Interview tip → Mention that timeouts also free up concurrency slots, not just money.

All GitHub Actions questions Roadmap: GitHub Actions

More on Speed, Caching & Cost