Uploaded image for project: 'Subversion'
  1. Subversion
  2. SVN-3546

Fix race condition in svnsync locking

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • ---
    • 1.7.0
    • svnsync

    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

      Attachments

        1. 1_svnsync-two-step-locking.patch
          10 kB
          Subversion Importer

        Activity

          People

            Unassigned Unassigned
            subversion-importer Subversion Importer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: