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

Deadlock Error #1

Open
tooolbox opened this issue Sep 24, 2020 · 2 comments
Open

Deadlock Error #1

tooolbox opened this issue Sep 24, 2020 · 2 comments

Comments

@tooolbox
Copy link

Nice package :)

I'm wondering if CanRetry() should return true for error code 1213? The message is Deadlock found when trying to get lock; try restarting transaction.

I can send a PR if this looks favorable.

@tooolbox
Copy link
Author

Eh, it's a little interesting, because you may want to retry a deadlock a few milliseconds later, whereas I could see you waiting a second or so for connection issues. So I personally don't need them all bundled together. Or rather, it might be correct to return true for CanRetry() on a code 1213 error, I would just need to use the lower-level API.

@cenkalti
Copy link

cenkalti commented Oct 2, 2020

As @tooolbox pointed out, in https://dev.mysql.com/doc/refman/8.0/en/innodb-deadlocks-handling.html it is advised to re-issue a transaction if it fails due to deadlock. I think error code 1213 should be added to CanRetry().

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

No branches or pull requests

2 participants