From: Ed R. <ed_...@ya...> - 2009-07-23 07:32:22
|
That's great, thanks John! (I'd be quite interested to see how you reproduced that in a test actually!) Regards Ed ----------------------------------------------------------- Ed Randall Senior Software Developer http://www.ingenotech.com ----------------------------------------------------------- --- On Wed, 22/7/09, John W. Lewis <Joh...@sa...> wrote: > From: John W. Lewis <Joh...@sa...> > Subject: RE: [Cobertura-devel] 1.9.2 data flush / lock file problems > To: "Ed Randall" <ed_...@ya...>, "Cob...@li..." <Cob...@li...> > Date: Wednesday, 22 July, 2009, 12:28 AM > > I have created a test that reproduces this > problem. The interesting thing is that I > cannot reproduce it with JDK1.5.0_12, but JDK1.6.0_14 fails > every time. > > The test passes with your patch, > Ed. Thanks! > > John > > > -----Original Message----- > From: Ed Randall [mailto:ed_...@ya...] > > Sent: Sunday, July 05, 2009 8:31 AM > To: Cob...@li... > Subject: Re: [Cobertura-devel] 1.9.2 data flush / lock file > problems > > Attached is a further patch to ProjectData.java which > eliminates all the problems I've been seeing. Coverage > data is no longer being lost and our stats are back where we > expect them to be. > > Basically the issue is that the technique used in > FileLocker only works "per JVM" - so if multiple threads > within one JVM running Cobertura try to save data > simultaneously - this file locking technique will fail with > the exception seen. > Our complex functional tests frequently spawn multiple > threads, and this problem will is the result. > My patch ensures that this cannot happen within one JVM by > synchronizing on an intern() of the path to the datafile. > > > Hope you can take this in to consideration for the next > release. > > Regards > > Ed > > > > |