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: 'Access is denied' when renaming module cache directory [1.13 backport] #37802

jayconrod opened this issue Mar 11, 2020 · 2 comments


Copy link

@jayconrod jayconrod commented Mar 11, 2020

Based on #36568.

CL 221820 mitigates #36568, an issue where antivirus (or a similar program) prevents modules from being extracted into the module cache. That CL makes two changes:

  1. os.Rename (the operation that fails) is re-attempted multiple times over 2000 ms. This should make the error less frequent, but doesn't eliminate it entirely.
  2. Adds compatibility with a future change, added in CL 221157 but disabled by default, where modules are extracted in place without requiring os.Rename.

CL 221157 is the proper solution for this problem, but it can't be enabled yet because older versions of the Go command (1.14 and earlier) assume that if a module directory is present, it is fully extracted and ready to use. So if Go 1.14 and 1.15 access the same module directory concurrently, 1.14 might see a partially extracted module. CL 221820 prevents that from happening.

The flag in CL 221157 can be flipped safely when 1.14 and older versions are no longer supported and no longer in use. That would probably be true for 1.17.

I'd like to speed up the migration by backporting CL 221820 to 1.14 and possibly 1.13. That would allow us to flip the flag in 1.16.


This comment has been minimized.

Copy link

@gopherbot gopherbot commented Mar 12, 2020

Change mentions this issue: [release-branch.go1.13] cmd/go: make module zip extraction more robust

@cagedmantis cagedmantis modified the milestones: Go1.13.9, Go1.13.10 Mar 19, 2020

This comment has been minimized.

Copy link

@cagedmantis cagedmantis commented Mar 20, 2020

Approved. This is a serious issue without a reasonable workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.