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

Merged
merged 1 commit into from Aug 22, 2017

Conversation

Projects
None yet
5 participants
@gcourtemanche
Contributor

gcourtemanche commented Aug 22, 2017

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

@rails-bot

This comment has been minimized.

Show comment
Hide comment
@rails-bot

rails-bot Aug 22, 2017

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.

rails-bot commented Aug 22, 2017

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.

Show outdated Hide outdated activerecord/lib/active_record/errors.rb
@rafaelfranca

Can you squash your commits?

@matthewd

This comment has been minimized.

Show comment
Hide comment
@matthewd

matthewd Aug 22, 2017

Member

Should this be TransactionTimeout? We've got Deadlocked, but that seems to be an exception.

Member

matthewd commented Aug 22, 2017

Should this be TransactionTimeout? We've got Deadlocked, but that seems to be an exception.

@rafaelfranca

This comment has been minimized.

Show comment
Hide comment
@rafaelfranca

rafaelfranca Aug 22, 2017

Member

What you recommend it to be? LockWaitTimeout?

Member

rafaelfranca commented Aug 22, 2017

What you recommend it to be? LockWaitTimeout?

@matthewd

This comment has been minimized.

Show comment
Hide comment
@matthewd

matthewd Aug 22, 2017

Member

@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.

Member

matthewd commented Aug 22, 2017

@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.

@rafaelfranca

This comment has been minimized.

Show comment
Hide comment
@rafaelfranca

rafaelfranca Aug 22, 2017

Member

Yeah, it makes sense. I think TransactionTimeout is better than LockWaitTimeout since it is more generic. @gcourtemanche can you rename the exception from TransactionTimedout to TransactionTimeout?

Member

rafaelfranca commented Aug 22, 2017

Yeah, it makes sense. I think TransactionTimeout is better than LockWaitTimeout since it is more generic. @gcourtemanche can you rename the exception from TransactionTimedout to TransactionTimeout?

@gcourtemanche gcourtemanche changed the title from Add TransactionTimedout for MySQL error code 1205 to Add TransactionTimeout for MySQL error code 1205 Aug 22, 2017

@gcourtemanche

This comment has been minimized.

Show comment
Hide comment
@gcourtemanche

gcourtemanche Aug 22, 2017

Contributor

@rafaelfranca Yes, renamed to TransactionTimeout

Contributor

gcourtemanche commented Aug 22, 2017

@rafaelfranca Yes, renamed to TransactionTimeout

@rafaelfranca rafaelfranca merged commit 80ccfec into rails:master Aug 22, 2017

2 checks passed

codeclimate All good!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

prathamesh-sonpatki added a commit to prathamesh-sonpatki/rails that referenced this pull request Aug 28, 2017

kamipo added a commit that referenced this pull request Aug 29, 2017

kamipo added a commit that referenced this pull request Nov 11, 2017

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