]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
In SQLITE_ENABLE_SETLK_TIMEOUT builds, use blocking locks in place of sleep() calls...
authordan <Dan Kennedy>
Tue, 28 Nov 2023 17:12:42 +0000 (17:12 +0000)
committerdan <Dan Kennedy>
Tue, 28 Nov 2023 17:12:42 +0000 (17:12 +0000)
FossilOrigin-Name: 4c055b7a6e4533e1e571773456226ca7038ce372df3eedbbbcd9a81e8652a6cf

1  2 
manifest
manifest.uuid
src/wal.c

diff --cc manifest
index bc7b1ca18cac8a5064467492f4f2870f43af81df,c28f30eb6f8af1995b6af287b927d72047d9e7d3..6390c0d3c48c81c332e774a40fa3dd0a40f1175c
+++ b/manifest
@@@ -1,5 -1,5 +1,5 @@@
- C Add\sthe\s--buildonly\sand\s--dryrun\soptions\sto\stestrunner.tcl.
- D 2023-11-24T20:14:18.100
 -C Handle\san\sSQLITE_BUSY_TIMEOUT\serror\sif\sone\soccurs\swhile\sattempting\sa\sshared\slock\son\sa\sread-lock\sslot.
 -D 2023-11-28T15:29:04.012
++C In\sSQLITE_ENABLE_SETLK_TIMEOUT\sbuilds,\suse\sblocking\slocks\sin\splace\sof\ssleep()\scalls\swhen\sopening\sa\sread-transaction.
++D 2023-11-28T17:12:42.879
  F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
  F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
  F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@@ -810,7 -810,7 +810,7 @@@ F src/vdbetrace.c fe0bc29ebd4e02c8bc5c1
  F src/vdbevtab.c 2143db7db0ceed69b21422581f434baffc507a08d831565193a7a02882a1b6a7
  F src/vtab.c 154725ebecd3bc02f7fbd7ad3974334f73fff76e02a964e828e48a7c5fb7efff
  F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9
- F src/wal.c 69aa3ce60b2862a24cd86bb528e653e2137388ead258ef64db49ec9038807f5f
 -F src/wal.c fb52b05da32d500575a9b4ce0bb1c03b69876ea0f0873d4a8b0ca262da34e540
++F src/wal.c e5247a3406531b705b44630e9ccf9ca0e5c74955ef19c06fbb146d765c500c20
  F src/wal.h ba252daaa94f889f4b2c17c027e823d9be47ce39da1d3799886bbd51f0490452
  F src/walker.c 7c7ea0115345851c3da4e04e2e239a29983b61fb5b038b94eede6aba462640e2
  F src/where.c 1fdc69ce1333e9bd6d7d3df9fa5af1373a3f5bfdd52108d1dbc0ca85a55f777e
@@@ -2143,8 -2143,8 +2143,9 @@@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a9
  F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
  F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
  F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
- P f8ea0b58b37f4052ded448e595d6d2992988a33b8ecfe58d68f20532f8cb5a37
- R a09b448e8fa45e3193b13a1fe5b499b2
 -P f797baf47cf7859cfd8ce248f4f3087af4551a7040af990333426e5a7c269504
 -R c6e742d8a411bdf1bc8b658a51b789de
++P a0c87ae9d3db914d18e2c8811db0d0ae3ad7b15c63de84fa975efce28bace27e 5fbf3906d272df3eb981f67455eb35f649ad2774cba9fc3f077b28d9bef3f0cb
++R a3e95520ff5d52f362b8ffc8bb5b50fd
++T +closed 5fbf3906d272df3eb981f67455eb35f649ad2774cba9fc3f077b28d9bef3f0cb
  U dan
- Z ce0098ca9d7841ef7ea900cfd937f5a5
 -Z 58f292c9c356eaa52cbcdd405bfb61bb
++Z fe1d300d9f65afce84bb98eff88fc681
  # Remove this line to create a well-formed Fossil manifest.
diff --cc manifest.uuid
index 5863b2909694b242ed378033be9dfc3bd6d67799,360d2aad65537553fb7f5329b149bcb8142b6791..a36bb8e2e70a712b49850bc0910c37e09529bfce
@@@ -1,1 -1,1 +1,1 @@@
- a0c87ae9d3db914d18e2c8811db0d0ae3ad7b15c63de84fa975efce28bace27e
 -5fbf3906d272df3eb981f67455eb35f649ad2774cba9fc3f077b28d9bef3f0cb
++4c055b7a6e4533e1e571773456226ca7038ce372df3eedbbbcd9a81e8652a6cf
diff --cc src/wal.c
index d83f361d64c25adf75ac2fda8338efb2af17eb11,2bdaa1c3fbd0eff640ad67f93d10e4403d6f8883..fa22e64c844c5603e7c864aa59e12239848eadd3
+++ b/src/wal.c
@@@ -2987,6 -2992,18 +2992,19 @@@ static int walTryBeginRead(Wal *pWal, i
        return SQLITE_PROTOCOL;
      }
      if( cnt>=10 ) nDelay = (cnt-9)*(cnt-9)*39;
 -    ** to block for locks for approximately nDelay us. This affects two
 -    ** locks (a) the WRITER lock taken in walIndexReadHdr() if the first
 -    ** attempted read fails and (b) the shared lock taken on the DMS slot
 -    ** in os_unix.c.  Both of these locks are attempted from within the 
 -    ** call to walIndexReadHdr() below.  */
+ #ifdef SQLITE_ENABLE_SETLK_TIMEOUT
+     /* In SQLITE_ENABLE_SETLK_TIMEOUT builds, configure the file-descriptor
++    ** to block for locks for approximately nDelay us. This affects three
++    ** locks: (a) the shared lock taken on the DMS slot in os_unix.c (if
++    ** using os_unix.c), (b) the WRITER lock taken in walIndexReadHdr() if the
++    ** first attempted read fails, and (c) the shared lock taken on the DMS
++    ** slot in os_unix.c. All three of these locks are attempted from within 
++    ** the call to walIndexReadHdr() below.  */
+     nBlockTmout = (nDelay+998) / 1000;
+     if( !useWal && walEnableBlockingMs(pWal, nBlockTmout) ){
+       nDelay = 1;
+     }
+ #endif
      sqlite3OsSleep(pWal->pVfs, nDelay);
    }