-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Create a proper Lock/Unlock #2
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just found out that there is a proposal to externalize good file
locking: golang/go#33974, but it hasn't seen
attention in a while. I think "good" locking will have to wait. For now,
I'm going to just use what kubeconfig uses (which is far from good).
So many seriously bad implementations of file locking exist. None of
them take into account the potential race condition of just looking for
the existence of a file (this ain't Windows). The proper way to do it is
to flock the file in addition to checking if it exists.
Here's an example of a failed lock
design that is all
throughout the Kubernetes code base (and Kind decided to copy it). Any
seasoned UNIX systems developer will immediately see the failures here:
I need to add a good Lock/Unlock to this package just so people can
see the difference for themselves and compare.
The text was updated successfully, but these errors were encountered: