Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[FIXED JENKINS-8882].
Clamp the lower bound of the predicted minimum number of idle executors
at 0 to prevent an IndexOutOfBoundsException.
(cherry picked from commit da4ddde)
  • Loading branch information
jsiirola authored and vjuranek committed Aug 17, 2011
1 parent b4b4e18 commit 8a2209f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/src/main/java/hudson/model/queue/MappingWorksheet.java
Expand Up @@ -327,6 +327,11 @@ public MappingWorksheet(BuildableItem item, List<? extends ExecutorSlot> offers,
}

int minIdle = max-peak; // minimum number of idle nodes during this time period
// total predicted load could exceed available executors [JENKINS-8882]
if (minIdle<0) {
// Should we toss a warning/info message?
minIdle = 0;
}
if (minIdle<list.size())
e.setValue(list.subList(0,minIdle));
}
Expand Down

0 comments on commit 8a2209f

Please sign in to comment.