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

Per record locking #46

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

mkopinsky
Copy link

@mkopinsky mkopinsky commented Mar 5, 2018

The Doctrine_Locking_Manager_Pessimistic has a bug where instead of locking by the record's ID, it was locking by the string "id". Which obviously meant you couldn't lock two things at once.

In our use case we were more interested in tracking the request ID which created a lock rather than the user, which explains the change of language from user_ident to lock_key in the PR. The changed column name I guess is technically BC-breaking for people actively using this, so we might want to revert that. (EDIT: the BC break has been reverted) On the other hand, given how clearly broken this was, I'm not sure if there even can be people using this in prod.

The added unit test fails when run against the code before these changes.

mcgrogan91 and others added 4 commits March 5, 2018 12:36
Using just the key column names caused the lock to exist on the entire table, instead of just the row for the supplied Doctrine_Record.  Modify the locking/finding/unlocking methods to use the actual key values instead.
We don't want a single user to have lock access, we want to limit it per request.

It makes more sense to just pass it a key which _could_ be a user ID, but more generally is just the ID of whatever we want to own the lock, be it a user or a request.
@mkopinsky
Copy link
Author

Hey @j0k3r any chance you could merge this?

@j0k3r
Copy link

j0k3r commented Apr 4, 2018

I'm sure about merging that.
@GromNaN what do you think?

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

Successfully merging this pull request may close these issues.

3 participants