How to match on MySQL deadlock? #2594
Unanswered
waynerobinson
asked this question in
Q&A
Replies: 1 comment
-
Maybe there is some other cleaner way of doing it but this worked for me:
(I'm just learning and spent many hours trying to figure this out.) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I don't seem to be able to work out how to match on a deadlock error.
When a MySQL query fails on deadlock it returns
Database(MySqlDatabaseError { code: Some("40001"), number: 1213, message: "Deadlock found when trying to get lock; try restarting transaction" })
however, I don't seem to be able to create a matcher for that as it seems it's private.Is there some example of matching on this deadlock error or potentially some automated retry logic for dealing with temporary deadlocks in contentious environments?
Beta Was this translation helpful? Give feedback.
All reactions