-
Notifications
You must be signed in to change notification settings - Fork 28
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
deadlock retry fails to save record that raises a deadlock in after hooks #10
Comments
Is there a fix for this issue? |
arrgh just faced this issue on Prod, after using the gem for couple years! now need to remove the gem, sigh.. |
Btw code example can be simpler:
with same output : ActiveRecord::RecordNotFound: Couldn't find MyTest with ID=1 |
I'm thinking about using this gem, just came across this issue. FWIW I don't see the problem when running either of the above examples in a console. The second, shorter example bails after 3 retries and raises
this running on rails v 3.2.16 |
If a deadlock occurs in an after commit hook for a record deadlock_retry will retry the commit but issues an "UPDATE" instead of an "INSERT" statement, resulting in the record never being saved even though calling #save returns true. This is easily demonstrated with the following code:
This will have the following output:
And if you look at the log you'll see:
The text was updated successfully, but these errors were encountered: