Mysql Error Codes on which to Retry Transaction

Viewed 237

I have few APIs which fail when the load on server is extremely high, predominantly one of the things that causes failure is Deadlock in Mysql/MariaDB Server.

So I decided to handle the application code to look for MySql error code 1213 for deadlock, and re-attempt that API after a minor wait.

So that got me thinking, what are other Mysql Error Codes, where it would be safe to retry the transaction? Is there any such list of mysql error codes?

0 Answers
Related