• Dan Jacques's avatar
    [cipd] Fix CIPD bootstraps run concurrently. · 7c2e05b4
    Dan Jacques authored
    It's currently possible for CIPD bootstraps that provision concurrently to:
    1) On Linux, step on each other during download, and
    2) On Windows, fail.
    
    Fix these respective scripts so that bootstraps are safe to use
    concurrently.
    
    On Linux and Mac, we download to a temporary file and use "mv" (atomic)
    to write it to the final destination. Concurrent initializations will
    perform parallel downloads, execute the "mv", and copy their downloaded
    file to the destination path.
    
    On Windows, we use filesystem locking to lock the operation and ensure
    that only one download can happen.
    
    BUG=chromium:739195
    TEST=local
      - Ran in parallel on Windows, Linux, and Max.
    
    Change-Id: Ie050d37598da67389f21728e781bd58904ef9c17
    Reviewed-on: https://chromium-review.googlesource.com/560521Reviewed-by: 's avatarRobbie Iannucci <iannucci@chromium.org>
    Commit-Queue: Daniel Jacques <dnj@chromium.org>
    7c2e05b4
cipd.ps1 2.55 KB