Skip to content
Commit 1f38518f authored by Kohsuke Kawaguchi's avatar Kohsuke Kawaguchi
Browse files

Fixing concurrency problems.

The following bug report from olamy made me look hard at the code, but I'm not spotting an obvious problem.
The binary search algorithm here seems to always satisfy the invariant of 0<=lo<=pivot<=hi<=size, so I can't understand how lo==size+1 at the end, for this to happen.

So the only thing I can think of is concurrency related, which is indeed buggy --- we are editing indices after they are set to instance fields, which violates the copy-on-write semantics. This commit fixes that.

Sep 21, 2012 9:38:35 PM jenkins.InitReactorRunner$1 onTaskFailed
SEVERE: Failed Loading job MahoutQM
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
	at java.util.ArrayList.rangeCheck(ArrayList.java:604)
	at java.util.ArrayList.get(ArrayList.java:382)
	at jenkins.model.lazy.SortedList.get(SortedList.java:60)
	at jenkins.model.lazy.AbstractLazyLoadRunMap.search(AbstractLazyLoadRunMap.java:381)
	at jenkins.model.lazy.AbstractLazyLoadRunMap.newestBuild(AbstractLazyLoadRunMap.java:243)
	at hudson.model.AbstractProject.getLastBuild(AbstractProject.java:998)
	at hudson.maven.AbstractMavenProject.createTransientActions(AbstractMavenProject.java:184)
	at hudson.model.AbstractProject.updateTransientActions(AbstractProject.java:665)
	at hudson.maven.MavenModule.updateTransientActions(MavenModule.java:411)
	at hudson.model.AbstractProject.onLoad(AbstractProject.java:299)
	at hudson.maven.MavenModule.onLoad(MavenModule.java:236)
	at hudson.model.Items.load(Items.java:221)
	at hudson.model.ItemGroupMixIn.loadChildren(ItemGroupMixIn.java:99)
parent de15893c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment