-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Replacing a lock file with temp file and rename #28072
Conversation
GCE e2e build/test passed for commit 45e2d84. |
Removing LGTM because the release note process has not been followed. |
|
||
func lockName(filename string) string { | ||
return filename + ".lock" | ||
return os.Rename(tempName, filename) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does the defer for temp.Close() work ok with os.Rename(...,...) on all platforms?
Discussion in #28034 (comment) suggests we are dropping this approach and keeping the lock file. @erictune thoughts? |
Apparently, rename is not atomic on OS X and Windows and with NFS homedir (http://stackoverflow.com/questions/5943853/atomic-rename-works-on-linux-is-there-a-way-to-emulate-it-on-windows-osx) Also, if a user runs So, bad suggestion on my part. Sorry for making you extra work. Suggest we keep it as it is. |
See #23964 and the original PR #28034
cc @alex-mohr @lavalamp