-
Notifications
You must be signed in to change notification settings - Fork 302
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
auto release lock on failure #2519
Comments
Hi @simonbyrne thanks for raising this. We've had a bit of a guess of what your use case for this is, but please let us know if we're off track. We think you're looking for a way to prevent more than one of the same job definition from running on a machine at a time, but you want the lock to be automatically clean up after the job exits (whether it succeeds or fails). We can look into ways to support this work flow. As you've noted, pre-exit hooks may be used as a workaround, and if you're executing a shell script, you may also want to look into trapping the EXIT as well. We agree that a way to avoid either of these would be useful, so we can take a look at creating it. Another observation is that if you don't need the lock to be scoped to the machine, you can use concurrency groups to achieve this in the pipeline definition. |
My use case is that we have multiple machines (on a HPC cluster) using a shared file system, and we want to prevent race conditions at certain points when they write to a common folder. I'm not 100% sure that pre-exit hooks will always be called (e.g. if jobs are killed by our cluster scheduler), so it would be helpful if the unlocking could be handled on the buildkite side. Thank you for the suggestion of concurrency groups: I wasn't aware they worked across builds, so that may suit our use case. Thanks! |
We have another use case for auto-release lock.
I made a wrong assumption about
Unfortunately, this script doesn't run when deployment is cancelled. |
Is your feature request related to a problem? Please describe.
According to this discussion, locks are not automatically released if a job fails.
Describe the solution you'd like
Automatically release locks at exit
Describe alternatives you've considered
The suggested solutions (using pre-exit hooks) are somewhat cumbersome.
Additional context
The text was updated successfully, but these errors were encountered: