diff options
author | dan <Dan Kennedy> | 2025-05-30 18:23:03 +0000 |
---|---|---|
committer | dan <Dan Kennedy> | 2025-05-30 18:23:03 +0000 |
commit | 88ed38ca6d4502959093a0e05d55a718369a0d9f (patch) | |
tree | 712d9bbbcb499b47b0d6a80ec2e6bb48785cedd1 /src | |
parent | f42ceb9075c6dc64e36c17a1836ea3a0a2b4e8f6 (diff) | |
download | sqlite-88ed38ca6d4502959093a0e05d55a718369a0d9f.tar.gz sqlite-88ed38ca6d4502959093a0e05d55a718369a0d9f.zip |
Avoid invoking the busy-handler if a blocking lock times out while attempting to open a snapshot transaction.
FossilOrigin-Name: fe11f85fd3283bb7002f43bd8b796e9e7b67f6d1a92eb676be06b46d1458fc1d
Diffstat (limited to 'src')
-rw-r--r-- | src/btree.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/btree.c b/src/btree.c index 1bd59a1b1..064856635 100644 --- a/src/btree.c +++ b/src/btree.c @@ -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); |