Skip to content
Permalink
Browse files

[FIXED JENKINS-8882].

Clamp the lower bound of the predicted minimum number of idle executors
at 0 to prevent an IndexOutOfBoundsException.
  • Loading branch information...
jsiirola authored and kohsuke committed Jun 17, 2011
1 parent 58f8a9f commit da4ddde7564a15f6e8d9ee83f8499b7369dbe24b
Showing with 5 additions and 0 deletions.
  1. +5 −0 core/src/main/java/hudson/model/queue/MappingWorksheet.java
@@ -336,6 +336,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));
}

0 comments on commit da4ddde

Please sign in to comment.
You can’t perform that action at this time.