-
Notifications
You must be signed in to change notification settings - Fork 36
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 an atomic lock check action. #37
Conversation
@josecv Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
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.
Needs docs as well, take a look at the last feature addition
Analogous to a hardware lock check, this will atomically try to acquire a specified lock (and wait until it can), then immediately release the lock. Co-authored-by: Rafay <[email protected]>
@josecv Thank you for signing the Contributor License Agreement! |
docs have been added |
I'm interested in hearing the use case for this before merging, in the interest of minimizing knobs. What does this solve over having two |
we use locks to implement environment freezes. in short, it's safe to have multiple deployments running at once, but at certain points we might choose to prevent all deployments. when a deployment job runs, it attempts to fetch a lock: if it can, that means the environment isn't frozen and deployments are permitted; the lock is immediately released so that a simultaneous deployment is allowed through. when we need to actually freeze an env, we manually place the lock in at first we did implement this using two an atomic check operation solves this problem, since it happens all at once. |
Interesting. This will indeed help, but it still won't completely save you from aborts. Someone could click 'abort' and cause the Going back to your use case, it actually sounds a bit like a read-write lock or exclusive/shared acquire semantics. This is discussed in some form as #35 and concourse/concourse#842. Some form of that feels like a better approach to me - the utility of the I'd be happy to work with y'all towards a proposed API/approach if you're interested. |
Sorry but I'm gonna close this out; I'm still fishy on this approach to the problem. Happy to hash out the other stuff I mentioned at some point though. |
Hi! I'm experiencing the same issue than @josecv commented on #37 (comment) |
Analogous to a hardware lock check, this will atomically try to acquire
a specified lock (and wait until it can), then immediately release the lock.
Co-authored-by: Rafay [email protected]