Hi. I'm glad You like the fix. In order to do a sensible integrationtest of the functionality in getIngestWriter I think it is necessary to take a step backwards to DefaultManagement.ingest(...), since this is the method calling getIngestWriter, and since the pid getting locked in the StringLock-class is not released in getIngestWriter but in releaseWriter.
I must confess I have no idea how to set up an integrationtest of either DefaultDOManager.getIngestWriter(...) or DefaultManagement.ingest(...) since they are rather complex classes with a lot of state. I'll be happy, though, to implement the test, but I need to be pointed in the right direction. -Jesper On tor, 2012-11-15 at 09:54 -0500, [email protected] wrote: > Jesper- > > Thanks so much for this contribution! On the committers' call today, we > discussed your fix and it looks very good. We would like to have an > integration test to go with it, especially (as we all know) concurrency is > very tricky. {grin} > > Will you have some time to create a test or two for this purpose? Perhaps you > can join us on the next committers' call to discuss this? > > --- > A. Soroka > Software & Systems Engineering :: Online Library Environment > the University of Virginia Library > > On Nov 12, 2012, at 9:08 AM, Jesper Damkjaer wrote: > > > This is a fix to fcrepo-1024. > > > > The fix moves the call to getWriteLock up before the check on objectExists. > > This way only one thread can be inside the part doing object creation > > without the need for an explicit synchronized statement. > > > > In this fix I have introduced a StringLock in order to ensure that if two > > threads with the same PID ar to being created concurrently, then the second > > thread reaching getWriteLock will wait until the first thread has finished. > > This will ensure, that if e.g. the first thread contains invalid xml, then > > the second thread will complete (if it is valid), because it waits on the > > first thread. > > > > You can merge this Pull Request by running: > > > > git pull https://github.com/damkjaer/fcrepo fcrepo-1024 > > Or view, comment on, or merge it at: > > > > https://github.com/fcrepo/fcrepo/pull/9 > > > > Commit Summary > > > > • Added a fix of fcrepo-1024 using a new lock-class, StringLock, to ens… > > • Added a fix of fcrepo-1024 using a new lock-class, StringLock, to ens… > > File Changes > > > > • M > > fcrepo-server/src/main/java/org/fcrepo/server/storage/DefaultDOManager.java > > (35) > > • A > > fcrepo-server/src/main/java/org/fcrepo/server/utilities/StringLock.java > > (176) > > • A > > fcrepo-server/src/test/java/org/fcrepo/server/utilities/StringLockTest.java > > (199) > > Patch Links > > > > • https://github.com/fcrepo/fcrepo/pull/9.patch > > • https://github.com/fcrepo/fcrepo/pull/9.diff > > — > > Reply to this email directly or view it on GitHub. > > > > > > > ------------------------------------------------------------------------------ > Monitor your physical, virtual and cloud infrastructure from a single > web console. Get in-depth insight into apps, servers, databases, vmware, > SAP, cloud infrastructure, etc. Download 30-day Free Trial. > Pricing starts from $795 for 25 servers or applications! > http://p.sf.net/sfu/zoho_dev2dev_nov > _______________________________________________ > Fedora-commons-developers mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/fedora-commons-developers > > > ------------------------------------------------------------------------------ Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov _______________________________________________ Fedora-commons-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/fedora-commons-developers
