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.
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.
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
- Increase executors per agent or add nodes/cloud agents for peak demand.
- Audit pipelines for
sleep/input/lock-waits insidenode {}and lift them out. - Use ephemeral cloud/Kubernetes agents that scale executors on demand.
How to prevent it
- Keep
input/sleep/lock-waits outsidenode {}so they use flyweight executors. - Size executor capacity for peak concurrent demand or autoscale agents.
- Monitor queue length and held-but-idle executors.