I'm just surfing around some code now, but I think it may be for a long-lived process like an IDE some of that weirdness exists.
On Jul 26, 2012, at 8:44 AM, Kristian Rosenvold wrote: > There is a race condition in parallel builds that occurs related to > this piece of code: > > http://maven.apache.org/ref/3.0.4/maven-core/xref/org/apache/maven/classrealm/DefaultClassRealmManager.html#75 > > The thing is, for some reason, there's a loop that retries the class > realm generation with a random suffix if the class realm already > exists. In a parallel run, there will be multiple threads requesting > the same realm-id, which semantically should map to the same instance > of the class realm. > > (Most plugins do not really mind if there's a duplicate class realm > every now and then, but some take it very seriously ;) > > I'm tempted to change the semantics of the "newRealm" method to > "getOrCreateRealm", since that seems to be the correct semantics no > matter what. I've tried tracking the origin of the while loop, and it > seems to be very old. Anyone have any idea of what purpose it served ? > > Kristian > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > Thanks, Jason ---------------------------------------------------------- Jason van Zyl Founder & CTO, Sonatype Founder, Apache Maven http://twitter.com/jvanzyl --------------------------------------------------------- I never make the mistake of arguing with people for whose opinions I have no respect. -- Edward Gibbon
