Skip to content

Commit

Permalink
db_mysql: re-try query in case of a server deadlock
Browse files Browse the repository at this point in the history
  • Loading branch information
razvancrainea committed Aug 6, 2018
1 parent 89796e3 commit baa1d2b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/db_mysql/dbase.c
Expand Up @@ -181,6 +181,10 @@ static inline int wrapper_single_mysql_real_query(const db_con_t *conn,
case CR_SERVER_LOST:
case CR_COMMANDS_OUT_OF_SYNC:
return -1; /* reconnection error -> <0 */
case ER_LOCK_DEADLOCK:
LM_WARN("server error (%i): %s\n", error,
mysql_error(CON_CONNECTION(conn)));
return -1; /* reconnection error -> <0 */
default:
LM_CRIT("driver error (%i): %s\n", error,
mysql_error(CON_CONNECTION(conn)));
Expand Down

0 comments on commit baa1d2b

Please sign in to comment.