提交 f7dbe863 编写于 作者: A Andrew Bayer

If you had two clouds and only the second one could provision a label, it'd...

If you had two clouds and only the second one could provision a label, it'd never get that far - check to see if a cloud can provision a label before trying to do so.
上级 ce8997e8
......@@ -180,18 +180,21 @@ public class NodeProvisioner {
for( Cloud c : hudson.clouds ) {
if(excessWorkload<0) break; // enough slaves allocated
// provisioning a new node should be conservative --- for example if exceeWorkload is 1.4,
// we don't want to allocate two nodes but just one.
// OTOH, because of the exponential decay, even when we need one slave, excess workload is always
// something like 0.95, in which case we want to allocate one node.
// so the threshold here is 1-MARGIN, and hence floor(excessWorkload+MARGIN) is needed to handle this.
Collection<PlannedNode> additionalCapacities = c.provision(label, (int)Math.round(Math.floor(excessWorkload+m)));
for (PlannedNode ac : additionalCapacities) {
excessWorkload -= ac.numExecutors;
LOGGER.info("Started provisioning "+ac.displayName+" from "+c.name+" with "+ac.numExecutors+" executors. Remaining excess workload:"+excessWorkload);
// Make sure this cloud actually can provision for this label.
if (c.canProvision(label)) {
// provisioning a new node should be conservative --- for example if exceeWorkload is 1.4,
// we don't want to allocate two nodes but just one.
// OTOH, because of the exponential decay, even when we need one slave, excess workload is always
// something like 0.95, in which case we want to allocate one node.
// so the threshold here is 1-MARGIN, and hence floor(excessWorkload+MARGIN) is needed to handle this.
Collection<PlannedNode> additionalCapacities = c.provision(label, (int)Math.round(Math.floor(excessWorkload+m)));
for (PlannedNode ac : additionalCapacities) {
excessWorkload -= ac.numExecutors;
LOGGER.info("Started provisioning "+ac.displayName+" from "+c.name+" with "+ac.numExecutors+" executors. Remaining excess workload:"+excessWorkload);
}
pendingLaunches.addAll(additionalCapacities);
}
pendingLaunches.addAll(additionalCapacities);
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册