See also investigations on JENKINS-15465

But 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.

11-Oct-2012 01:21:42 jenkins.model.lazy.AbstractLazyLoadRunMap search
WARNING: lo=0, hi=22, pivot=11, size=22
11-Oct-2012 01:21:42 jenkins.model.lazy.AbstractLazyLoadRunMap search
WARNING: lo=12, hi=22, pivot=17, size=22
11-Oct-2012 01:21:42 jenkins.model.lazy.AbstractLazyLoadRunMap search
WARNING: lo=18, hi=22, pivot=20, size=21
11-Oct-2012 01:21:42 jenkins.InitReactorRunner$1 onTaskFailed
SEVERE: Failed Loading job tcserv
java.lang.ArrayIndexOutOfBoundsException: lo=18, hi=22, pivot=20, size=21

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.

public SortedList(List<T> data) {
        this.data = ""
        assert isSorted();
    }

This can be fixed using

this.data = "" class="code-keyword">new ArrayList(data);
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to