Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: "go help cache" does not specify if concurrent invocations of go are safe wrt the cache #26677

Open
mark-rushakoff opened this issue Jul 29, 2018 · 3 comments
Labels
Documentation NeedsFix
Milestone

Comments

@mark-rushakoff
Copy link
Contributor

@mark-rushakoff mark-rushakoff commented Jul 29, 2018

What version of Go are you using (go version)?

go version go1.10.3 darwin/amd64

Does this issue reproduce with the latest release?

Same or nearly same documentation with go version devel +154394f8d3 Sun Jul 29 15:42:29 2018 +0000 darwin/amd64

What did you do?

My team is trying to speed up our CI runs, and I wanted to investigate whether it would be safe for different Jenkins jobs, running go test concurrently, to share the same GOCACHE, to take advantage of test caching. I looked at the output of go help cache and didn't see any mention of expected behavior with concurrent runs of go with respect to the cache.

What did you expect to see?

I expected to see some mention of what is expected to happen when invoking go concurrently. Perhaps "it is safe" to do so, or "if concurrent runs of go attempt to warm the same cache entry, the last one wins", or "concurrent runs of go may fail if the same cache file is modified by a different go process".

What did you see instead?

No mention of expected behavior.

We're intending to assume the best behavior in the meantime, but I was slightly surprised that it wasn't mentioned in the docs.

/cc @rsc

@andybons
Copy link
Member

@andybons andybons commented Jul 30, 2018

@bcmills
@gopherbot label NeedsInvestigation

@gopherbot gopherbot added the NeedsInvestigation label Jul 30, 2018
@andybons andybons added this to the Go1.11 milestone Jul 30, 2018
@bcmills
Copy link
Member

@bcmills bcmills commented Jul 30, 2018

Concurrent uses are explicitly safe. The cache is content-addressed, so the act of populating cache entries should be idempotent.

@bcmills bcmills self-assigned this Aug 1, 2018
@rsc rsc removed this from the Go1.11 milestone Aug 17, 2018
@rsc rsc added this to the Go1.12 milestone Aug 17, 2018
@rsc rsc added NeedsFix and removed NeedsInvestigation labels Aug 17, 2018
@apparentlymart
Copy link

@apparentlymart apparentlymart commented Aug 29, 2018

I think #26794 is somewhat-related. It's not talking about GOCACHE directly, but is another reason why concurrently running go commands may not be safe. Perhaps worth mentioning that in the documentation produced by this issue too.

@bcmills bcmills removed this from the Go1.12 milestone Jan 18, 2019
@bcmills bcmills added this to the Go1.13 milestone Jan 18, 2019
@bcmills bcmills removed this from the Go1.13 milestone Jan 18, 2019
@bcmills bcmills added this to the Go1.12 milestone Jan 18, 2019
@andybons andybons removed this from the Go1.12 milestone Feb 12, 2019
@andybons andybons added this to the Go1.13 milestone Feb 12, 2019
@andybons andybons removed this from the Go1.13 milestone Jul 8, 2019
@andybons andybons added this to the Go1.14 milestone Jul 8, 2019
@rsc rsc removed this from the Go1.14 milestone Oct 9, 2019
@rsc rsc added this to the Backlog milestone Oct 9, 2019
@rsc rsc unassigned bcmills Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation NeedsFix
Projects
None yet
Development

No branches or pull requests

6 participants