File tree Expand file tree Collapse file tree
Plan/common/src/main/java/com/djrapitops/plan/storage/database/transactions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -105,12 +105,13 @@ private void manageFailure(SQLException statementFail) {
105105 int errorCode = statementFail .getErrorCode ();
106106 boolean mySQLDeadlock = dbType == DBType .MYSQL && errorCode == 1213 ;
107107 boolean deadlocked = mySQLDeadlock || statementFail instanceof SQLTransactionRollbackException ;
108- if (deadlocked && attempts < ATTEMPT_LIMIT ) {
108+ boolean lockWaitTimeout = errorCode == 1205 ;
109+ if (deadlocked || lockWaitTimeout && attempts < ATTEMPT_LIMIT ) {
109110 executeTransaction (db ); // Recurse to attempt again.
110111 return ;
111112 }
112113
113- if (dbType == DBType .MYSQL && errorCode == 1205 ) {
114+ if (dbType == DBType .MYSQL && lockWaitTimeout ) {
114115 if (!db .isUnderHeavyLoad ()) {
115116 db .getLogger ().warn ("Database appears to be under heavy load. Dropping some unimportant transactions and adding short pauses for next 10 minutes." );
116117 db .getRunnableFactory ().create (db ::assumeNoMoreHeavyLoad )
You can’t perform that action at this time.
0 commit comments