-
Notifications
You must be signed in to change notification settings - Fork 211
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
Implement a simple "build.lock" file. #780
Conversation
Boy this is tricky. I might revert all changes but the lock file implementation itself until I can get either of your help. Let me know. |
Yes, this is trickier than it appears - even if you properly clean up the lockfile after the builds then you still might miss the case where somebody kills the task manually in the middle of a build. I also would prefer the lockfile to be in the One option that comes to mind is never actually trying to delete the lockfile at all. Instead you just put the pid of the current build task in it. Then when another build tries to run it sees if there is an active task that looks like a build script (the hard part...) with that pid. If not it replaces the file with its own pid and does a build and otherwise it errors or possibly waits to start a build. Some other thoughts:
|
Fixes #352.
Let me know if you think we should add anything else (tests, etc). I did a couple of tests locally with the
e2e_example
package, and it seems to work pretty well.