mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Avoid invoking the busy-handler if a blocking lock times out while attempting to open a snapshot transaction.
FossilOrigin-Name: fe11f85fd3283bb7002f43bd8b796e9e7b67f6d1a92eb676be06b46d1458fc1d
This commit is contained in:
@@ -3697,6 +3697,14 @@ static SQLITE_NOINLINE int btreeBeginTrans(
|
||||
(void)sqlite3PagerWalWriteLock(pPager, 0);
|
||||
unlockBtreeIfUnused(pBt);
|
||||
}
|
||||
#if defined(SQLITE_ENABLE_SETLK_TIMEOUT) && defined(SQLITE_ENABLE_SNAPSHOT)
|
||||
if( rc==SQLITE_BUSY_TIMEOUT ){
|
||||
/* If a blocking lock timed out, break out of the loop here so that
|
||||
** the busy-handler is not invoked. This can only happen when opening
|
||||
** a transaction on a snapshot. */
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}while( (rc&0xFF)==SQLITE_BUSY && pBt->inTransaction==TRANS_NONE &&
|
||||
btreeInvokeBusyHandler(pBt) );
|
||||
sqlite3PagerWalDb(pPager, 0);
|
||||
|
Reference in New Issue
Block a user