A python script is running two parallel python processes ( created via os.fork() ) each of which eventually tries to check out a subversion repository leaf into the same working copy dir.
Before running 'svn co ...' command in a sub-process ( via python subprocess module ) the parent python code checks if the working copy dir already exists.
if os.path.isdir(checkout_dir):
# working copy dir already exists
return checkout_dir
So that if it does there shouldn't be any 'svn co' running, but rather immediate return from the parent function.
Nevertheless some collision happened and one of the python processes failed on 'svn co ..' with the following error.
checked-out failed: svn: Working copy '/tmp/qm_23683' locked
svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details)**
So the first question is why the working copy dir existence check didn't work and the second - is there a way to find out that a working copy dir is locked by svn and loop until it is unlocked?
Thanks.