Jenkins does not restart slaves after idle timeout

amazon ec2Jenkins

I've got Jenkins set up with a master and one EC2 slave.

  • The master is set up with # of executors: 0

The slave is set up with

  • of executors: 2

  • Stop/Disconnect on Idle Timeout
  • Utilize this node as much as possible

When the slave is offline, and a new build is scheduled, it just hangs on pending—Waiting for next available executor. The slave is not started.

Launching the slave manually via the UI in Jenkins works fine. My builds are then run.

Am I missing a setting? Should Jenkins not fire up the slave when it is needed?

Thanks

Best Answer

The latest stable release of Jenkins just looked at the instance AMI ID to determine if any slaves were running. Since our master had the same AMI as the slaves, Jenkins figured we had reached our maximum amount of slaves (1).

Upgrading to a SNAPSHOT version of Jenkins solved the issue. It now adds a tag to all slaves, and uses that when counting.