diff --git a/changelog.html b/changelog.html index 9cef01f6415702a92db68d2cee163838d6de997d..8d8b5fc98224ba1ced04664bc352d371243fd69c 100644 --- a/changelog.html +++ b/changelog.html @@ -81,7 +81,10 @@ Upcoming changes Strongly encrypt proxy credentials (issue 4002)
  • - Added an extension point to allow prodding the NodeProvisioner into taking action faster than it might usually. + Added an extension point to allow prodding the NodeProvisioner into taking action faster than it might usually. +
  • + When there are absolutely no executors for a specific label, there was an unnecessary delay in provisioning the + first node for that label. diff --git a/core/src/main/java/hudson/slaves/NodeProvisioner.java b/core/src/main/java/hudson/slaves/NodeProvisioner.java index c72091a97361d704aa1f2b190a32e4bfb23ba8f8..7c6a9559586f3f25f691a034c74ae40fcddc523e 100644 --- a/core/src/main/java/hudson/slaves/NodeProvisioner.java +++ b/core/src/main/java/hudson/slaves/NodeProvisioner.java @@ -143,7 +143,7 @@ public class NodeProvisioner { Hudson hudson = Hudson.getInstance(); // clean up the cancelled launch activity, then count the # of executors that we are about to bring up. - float plannedCapacity = 0; + int plannedCapacitySnapshot = 0; for (Iterator itr = pendingLaunches.iterator(); itr.hasNext();) { PlannedNode f = itr.next(); if(f.future.isDone()) { @@ -159,8 +159,9 @@ public class NodeProvisioner { } itr.remove(); } else - plannedCapacity += f.numExecutors; + plannedCapacitySnapshot += f.numExecutors; } + float plannedCapacity = plannedCapacitySnapshot; plannedCapacitiesEMA.update(plannedCapacity); /* @@ -197,8 +198,9 @@ public class NodeProvisioner { int idleSnapshot = stat.computeIdleExecutors(); int totalSnapshot = stat.computeTotalExecutors(); + boolean needSomeWhenNoneAtAll = ((totalSnapshot + plannedCapacity) == 0) && (stat.computeQueueLength() > 0); float idle = Math.max(stat.getLatestIdleExecutors(TIME_SCALE), idleSnapshot); - if(idle1-m) {// and there's more work to do... LOGGER.fine("Excess workload "+excessWorkload+" detected. (planned capacity="+plannedCapacity+",Qlen="+qlen+",idle="+idle+"&"+idleSnapshot+",total="+totalSnapshot+"m,="+m+")");