Skip to content
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

Add ActiveRecord::Base.connection.with_advisory_lock #41350

Merged
merged 1 commit into from Feb 8, 2021

Conversation

rafaelfranca
Copy link
Member

This method allow applications to obtain an exclusive session level advisory lock, if available, for the duration of the block.

If another session already have the lock, the method will return false and the block will not be executed.

@rafaelfranca rafaelfranca force-pushed the rm-advisory-lock branch 2 times, most recently from c7195d9 to 08d975a Compare February 5, 2021 21:56
@rafaelfranca rafaelfranca merged commit c8acff8 into main Feb 8, 2021
@rafaelfranca rafaelfranca deleted the rm-advisory-lock branch February 8, 2021 18:22
@eileencodes
Copy link
Member

I stumbled across this while searching for another advisory lock PR. For historical purposes, I'm linking the revert commit here 561fa1e

This reverts commit 1ab4dbf8aad83a451c3d2a6c24bc87012b2303c2.

After speaking with Shopify's resident database experts, they
recommended me to not expose this feature in the public API.
The reason why they don't recommend it, is that this kind of locking
break multiplexing mechanisms like ProxySQL and can decrease the
resiliency of the application.

My original motivation was to remove a monkey patch in our application
and since we are not planning to allow people to use that feature in our
application anymore there is no reason to me expose this locking mechanism
anymore in the framework.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants