Skip to content

Commit

Permalink
Merge pull request #1353 from daniel-beck/JENKINS-24095
Browse files Browse the repository at this point in the history
[FIXED JENKINS-24095] Ensure only numExecutors exist when reducing
  • Loading branch information
daniel-beck committed Aug 14, 2014
2 parents 2ea7e62 + 05a26da commit 7fb4591
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions core/src/main/java/hudson/model/Computer.java
Expand Up @@ -729,9 +729,16 @@ private void addNewExecutorIfNecessary() {
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);
}
}

}

/**
Expand Down

0 comments on commit 7fb4591

Please sign in to comment.