Merge pull request #1353 from daniel-beck/JENKINS-24095

[FIXED JENKINS-24095] Ensure only numExecutors exist when reducing
This commit is contained in:
Daniel Beck committed 2014-08-14 14:53:57 +02:00
commit 7fb4591bdc
1 file changed
+9 -2
@@ -729,9 +729,16 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces
availableNumbers.remove(executor.getNumber());
for (Integer number : availableNumbers) {
Executor e = new Executor(this, number);
executors.add(e);
/* There may be busy executors with higher index, so only
fill up until numExecutors is reached.
Extra executors will call removeExecutor(...) and that
will create any necessary executors from #0 again. */
if (executors.size() < numExecutors) {
Executor e = new Executor(this, number);
executors.add(e);
}
}
}
/**