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 TransactionTimeout for MySQL error code 1205 #30360
Conversation
Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @schneems (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. This repository is being automatically checked for code quality issues using Code Climate. You can see results for this analysis in the PR status below. Newly introduced issues should be fixed before a Pull Request is considered ready to review. Please see the contribution instructions for more information. |
@@ -334,4 +334,9 @@ class Deadlocked < TransactionRollbackError | |||
# +reverse_order+ to automatically reverse. | |||
class IrreversibleOrderError < ActiveRecordError | |||
end | |||
|
|||
# TransactionTimedout will be raised when lock wait timeout expires. | |||
# wait time value is set by innodb_lock_wait_timeout |
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.
Wait
instead of wait
. And it is missing a .
in the end.
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.
Fixed, thank you
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.
Can you squash your commits?
Should this be |
What you recommend it to be? |
@rafaelfranca either one seems fine to me. TransactionTimedout sounds less consistent... I think the noun form fits with wider exception naming: it's FrobError, not FrobFailed. It's a fairly fine distinction, but I think an exception describes what occurred that prevented the action, rather than why the action couldn't be performed. |
Yeah, it makes sense. I think |
@rafaelfranca Yes, renamed to |
Added CHANGELOG for #30360 [ci skip]
Summary
This PR adds
TransactionTimedout
error to the MySQL adapter.Message: Lock wait timeout exceeded; try restarting transaction
(MySQL error 1205) will be easier to rescue.https://dev.mysql.com/doc/refman/5.7/en/error-messages-server.html#error_er_lock_wait_timeout
cc @rafaelfranca