Class EC2HotSpareQueueListener

java.lang.Object
hudson.model.queue.QueueListener
hudson.plugins.ec2.EC2HotSpareQueueListener
All Implemented Interfaces:
ExtensionPoint

@Extension public class EC2HotSpareQueueListener extends QueueListener
Asks for a hot spare pass as soon as a build is ready to run.

Without this, the first build for a label that has nothing warm has to wait for the periodic sweep before any spare is even requested, and the label's own agents cannot fill the gap: an executor being taken is the other trigger, and with no capacity there is no executor to take. That is minutes of latency spent on exactly the case the spares exist to cover.

Queue.BuildableItem is in the queue's buildable list by the time this runs, so the pass this schedules counts it. No provisioning decision is made here: this runs under the Queue lock, where the only safe thing to do is hand the work to MinimumInstanceChecker.scheduleCheck() and return.