Skip to content
Latchkey

Jenkins Executor Starvation - Builds Stall Holding Executors

All executors are occupied - but often by builds that are idle, not working. An input or sleep inside a node {} holds a heavyweight executor while it waits, so other builds starve in the queue even though no real work is happening.

What this error means

Many builds sit queued while running builds appear to be doing nothing (waiting on input, sleep, or a lock). Executor utilization is "full" but throughput is low - capacity is held, not used.

Jenkins queue
Running builds: 4/4 executors busy
- app #88  : waiting on input "Deploy?" (holding executor)
- app #89  : sleep 600 inside node{} (holding executor)
Queued: 12 builds (pending - Waiting for next available executor)

Common causes

Idle waits inside node {} hold executors

An input, sleep, or long lock-wait placed inside a node {} keeps the heavyweight executor allocated for the entire wait, starving other builds.

Too few executors for demand

Total executor capacity is simply below peak concurrent build demand, so the queue backs up even when builds are working efficiently.

How to fix it

Move idle waits outside node {}

Wait for approval or sleep outside any node block so the wait does not hold an executor.

Jenkinsfile
stage('Approve') {
  steps {
    // no node{} here - runs on a flyweight executor, holds no agent
    timeout(time: 30, unit: 'MINUTES') { input 'Deploy?' }
  }
}
stage('Deploy') { agent { label 'linux' } steps { sh './deploy.sh' } }

Add capacity and rebalance

  1. Increase executors per agent or add nodes/cloud agents for peak demand.
  2. Audit pipelines for sleep/input/lock-waits inside node {} and lift them out.
  3. Use ephemeral cloud/Kubernetes agents that scale executors on demand.

How to prevent it

  • Keep input/sleep/lock-waits outside node {} so they use flyweight executors.
  • Size executor capacity for peak concurrent demand or autoscale agents.
  • Monitor queue length and held-but-idle executors.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →