It's been a while, but about a year or more ago I wrote a test for 
Akubra to test a fix to a race condition that Adam had pointed out.  It 
uses the Threadweaver library:

http://code.google.com/p/thread-weaver/

Here's the test I wrote:

https://github.com/akubra/akubra/blob/master/akubra-fs/src/test/java/org/akubraproject/fs/TestFSBlobThreaded.java

Basically, Threadweaver allows you to create tests that spawn multiple 
threads, then provoke race conditions, etc., and test how they are handled.

-- Scott

On 11/15/2012 08:54 AM, aj...@virginia.edu 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
> Fedora-commons-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fedora-commons-developers


-- 
Scott Prater
Shared Development Group
General Library System
University of Wisconsin - Madison
pra...@wisc.edu
5-5415


------------------------------------------------------------------------------
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
Fedora-commons-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fedora-commons-developers

Reply via email to