Description
This fixes the race condition where two svnsync processes can lock the repository at the same time (as noticed by Stefan Sperling earlier today). I wanted to do this without changing the RA layer, so that it can work with older servers. Since the RA layer doesn't have a test-and-set primitive (other than a commit!), some raciness is inevitable. This patch fixes the dangerous race, but introduces a much less dangerous race. With this patch, two "svnsync" processes trying to lock the repository at the same time might both fail to get the lock. To mitigate this, both processes will sleep for a random amount of time before retrying. This should reduce the chance of them staying in lock-step and repeatedly failing. (Hopefully the chance becomes negligible). This doesn't conflict with my --use-external-locking patch from earlier today; they change different parts of the code and have different use-cases. [Logged as Issue 3545]
Original issue reported by gavinbaumanis