]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/modfetch: lock files and directories
authorBryan C. Mills <bcmills@google.com>
Mon, 15 Oct 2018 19:52:01 +0000 (15:52 -0400)
committerBryan C. Mills <bcmills@google.com>
Thu, 29 Nov 2018 18:49:31 +0000 (18:49 +0000)
commit04e12a5bfa51777c4ba46ed2e026f53578206754
tree7ba4fa3d5214e9d4f19997fc1bd25bfcc09bed58
parentba2e8f65ab36f145177419c56cc03adf67f0e167
cmd/go/internal/modfetch: lock files and directories

We employ the following new locking mechanisms:

• Zip files and list files within the module cache are written using
  atomic renames of temporary files, so that GOPROXY servers reading
  from the cache will never serve incomplete content.

• A lock file for each module version guards downloading and extraction of
  (immutable) module contents.

• A lock file alongside each version list (named 'list.lock')
  guards updates to the list.

• A single lock file in the module cache guards updates to all go.sum
  files. The go.sum files themselves are written using an atomic
  rename to ensure that we never accidentally discard existing sums.

Updates #26794

RELNOTE=yes

Change-Id: I16ef8b06ee4bd7b94d0c0a6f5d17e1cecc379076
Reviewed-on: https://go-review.googlesource.com/c/146382
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/go/internal/clean/clean.go
src/cmd/go/internal/modfetch/cache.go
src/cmd/go/internal/modfetch/fetch.go
src/cmd/go/internal/modfetch/unzip.go
src/cmd/go/testdata/script/mod_concurrent.txt [new file with mode: 0644]