-
Bug
-
Resolution: Fixed
-
Major
-
Windows Server 2008 R2
After upgraded to 1.485, following exception occurs while Jenkins starting up.
2012/10/9 10:53:40AM jenkins.InitReactorRunner$1 onTaskFailed SEVERE: Failed Loading job prc-production java.lang.IndexOutOfBoundsException: Index: 20, Size: 20 at java.util.ArrayList.RangeCheck(Unknown Source) at java.util.ArrayList.get(Unknown Source) at jenkins.model.lazy.SortedList.get(SortedList.java:60) at jenkins.model.lazy.AbstractLazyLoadRunMap.search(AbstractLazyLoadRunMap.java:402) at jenkins.model.lazy.AbstractLazyLoadRunMap.newestBuild(AbstractLazyLoadRunMap.java:287) at hudson.model.AbstractProject.getLastBuild(AbstractProject.java:998) at hudson.maven.AbstractMavenProject.createTransientActions(AbstractMavenProject.java:184) at hudson.maven.MavenModuleSet.createTransientActions(MavenModuleSet.java:365) ...
See also investigations on
JENKINS-15465But the symptom/fix is more in line with what is reported here.
I added some logging to AbstractLazyLoadRunMap to watch how lo, hi, pivot and size changed when high ended up being greater than size. I also added logging to trigger when r was detected as null at line 724.
In this failing scenario the debug for r==null never triggers but size reduces.
I've tracked this down to SortedList doing a shallow clone another list and sharing the same underlying data list. Thus if another thread is accessing the list and removes an item the clone will see the item removed too.
This can be fixed using