From cdbfe6a93884bd1dceca9d971be95dba0fbadccb Mon Sep 17 00:00:00 2001 From: stephan Date: Wed, 30 Sep 2026 13:23:56 +0000 Subject: [PATCH] Do not inherit the OPFS SAHPool's xSleep method from the default VFS, as doing so can cause the thread to freeze. This VFS only deals with contention originating in the same thread, so xSleep() needs to be a no-op. Addresses [forum:3f0794c5d8|bug report 2026-09-30T12:52:54Z]. FossilOrigin-Name: c9dd4d88e44a9eae4ea11d0ce5491c7ac2ac2d60a3bc83ed485812234be374da --- ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js | 12 ++++++++---- manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js b/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js index ac5e2a2248..cb4864e3be 100644 --- a/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js +++ b/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js @@ -462,7 +462,6 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){ /* Inherit certain VFS members from the default VFS, if available. */ opfsVfs.$xRandomness = dVfs.$xRandomness; - opfsVfs.$xSleep = dVfs.$xSleep; dVfs.dispose(); } if(!opfsVfs.$xRandomness && !vfsMethods.xRandomness){ @@ -475,9 +474,14 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){ return i; }; } - if(!opfsVfs.$xSleep && !vfsMethods.xSleep){ - vfsMethods.xSleep = (pVfs,ms)=>0; - } + /** + This VFS's xSleep() must be a no-op. In this environment, + only db handles within the same thread can ever come into + contention, and that contention cannot be resolved if + one of the handles sleeds in that same thread. + See also: forum:3f0794c5d8 + */ + vfsMethods.xSleep = (pVfs,ms)=>0; sqlite3.vfs.installVfs({ vfs: {struct: opfsVfs, methods: vfsMethods} }); diff --git a/manifest b/manifest index 71b2c1b7b7..eb887e9c49 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C JS:\swhen\sdisposing\sof\sa\sC\sstruct\sinstance,\sdo\snot\sunmap\sthe\s'pointer'\sproperty\sinterceptor\suntil\safter\sall\sclient-added\sfinalizers\shave\sbeen\scalled. -D 2026-09-30T13:18:14.287 +C Do\snot\sinherit\sthe\sOPFS\sSAHPool's\sxSleep\smethod\sfrom\sthe\sdefault\sVFS,\sas\sdoing\sso\scan\scause\sthe\sthread\sto\sfreeze.\sThis\sVFS\sonly\sdeals\swith\scontention\soriginating\sin\sthe\ssame\sthread,\sso\sxSleep()\sneeds\sto\sbe\sa\sno-op.\sAddresses\s[forum:3f0794c5d8|bug\sreport\s2026-09-30T12:52:54Z]. +D 2026-09-30T13:23:56.388 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -609,7 +609,7 @@ F ext/wasm/api/sqlite3-license-version-header.js 98d90255a12d02214db634e041c8e7f F ext/wasm/api/sqlite3-opfs-async-proxy.c-pp.js f378c8edd98941bdfa32bae0db86f5cc6410c69b28943d9761f2d95511630029 F ext/wasm/api/sqlite3-vfs-helper.c-pp.js 57a54bd6351a52100743b1eac44fc20a858f44838df249bb1e7facac2127b110 F ext/wasm/api/sqlite3-vfs-kvvfs.c-pp.js 6327e15f7ffeb471ed1dc10ed98aab1896d61c2ec9c6646a337d4d2f8b3f7bb9 -F ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js f8ebfd97054aec2d4212aa1a42e0f80a595187466722cf19e31fcc71b91d5310 +F ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js d63b2857da2234759820d592f808b37f64c9d24d6b1623d75b1104ecce9dfc28 F ext/wasm/api/sqlite3-vfs-opfs-wl.c-pp.js 60fa106fc11d31adb1773ac16dd60fc9335a35496b0ca7bab8b4032cb61a441b F ext/wasm/api/sqlite3-vfs-opfs.c-pp.js 5dd8410121acf623ce53005a4aab2c7b2b7f5d1ad072f69ebc208882bc7b7236 F ext/wasm/api/sqlite3-vtab-helper.c-pp.js 3218318194b11fa625ebda9f7900280c5c26cf257ab5b2b66709ce58e9531624 @@ -2221,8 +2221,8 @@ F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee F tool/warnings.sh a554d13f6e5cf3760f041b87939e3d616ec6961859c3245e8ef701d1eafc2ca2 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f F tool/winmain.c 00c8fb88e365c9017db14c73d3c78af62194d9644feaf60e220ab0f411f3604c -P 9e2caaa382cee5d5df26ad3af7d727ab3f68a912e39655ffcc52f592d5a08a8d -R bee390359e76358b84c4ea5fe5ff4089 +P fa44643f65d6815c8c21ec25e7aa6e39a00fdc818d1d058e03123042e45884e1 +R 3a63c51ccb58b2a22c00bdb1b8f5247c U stephan -Z 4ff29a481b1fb8b2a35002dd6ce97aa5 +Z 901de4bdf6f0c30a65a3330271325068 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 373282ea32..a3c528ac13 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -fa44643f65d6815c8c21ec25e7aa6e39a00fdc818d1d058e03123042e45884e1 +c9dd4d88e44a9eae4ea11d0ce5491c7ac2ac2d60a3bc83ed485812234be374da