Skip to content
Snippets Groups Projects
Select Git revision
  • master default protected
  • juerg/cache-query-job-benchmark
  • bst-1 protected
  • juerg/cache-query-job
  • tristan/fix-recursive-artifact-pull
  • nanonyme/remove-fix-python-timestamps
  • tristan/shell-artifacts
  • bschubert/update-coverage
  • juerg/remote-cache
  • nanonyme/subprocess-devnull
  • tristan/artifact-extensions
  • tpollard/custom-platform-properties
  • juerg/buildbox
  • chandan/update-reqs
  • chandan/moar-runners
  • tpollard/optional-sandbox-properties
  • nanonyme/fix-tests
  • bschubert/standardize-source-tests
  • nanonyme/warn-nofile
  • abderrahim/stage-artifact-scriptelement
  • 1.6.1
  • 1.6.0
  • 1.93.5
  • 1.5.1
  • 1.93.4
  • bst-1.4-branchpoint protected
  • 1.5.0
  • 1.4.3
  • 1.93.3
  • 1.93.2
  • 1.4.2
  • 1.93.1
  • 1.93.0
  • 1.91.3
  • 1.91.2
  • 1.91.1
  • 1.91.0
  • bst-1-branchpoint protected
  • 1.4.1
  • 1.4.0
40 results

git.py

  • Tristan Van Berkom's avatar
    df18d38c
    git.py: Handle concurrent download completions properly · df18d38c
    Tristan Van Berkom authored
    Use os.rename() to rename the cloned temporary repository into
    place in the source cache, and issue a STATUS message when discarding
    a duplicate clone, in the case where the same repository is cloned
    twice in parallel.
    
    The problem with using shutil.move() is that it will create the source
    directory in a subdirectory of the destination when the destination
    exists, so it's behavior depends on whether the destination exists.
    
    This shutil.move() behavior has so far hidden the race condition
    where a duplicate repo is created in a subdirectory, as you need
    to have three concurrent downloads of the same repo in order to
    trigger the error.
    
    This fixes issue #503
    df18d38c
    History
    git.py: Handle concurrent download completions properly
    Tristan Van Berkom authored
    Use os.rename() to rename the cloned temporary repository into
    place in the source cache, and issue a STATUS message when discarding
    a duplicate clone, in the case where the same repository is cloned
    twice in parallel.
    
    The problem with using shutil.move() is that it will create the source
    directory in a subdirectory of the destination when the destination
    exists, so it's behavior depends on whether the destination exists.
    
    This shutil.move() behavior has so far hidden the race condition
    where a duplicate repo is created in a subdirectory, as you need
    to have three concurrent downloads of the same repo in order to
    trigger the error.
    
    This fixes issue #503