From 9b183a234c2adec1bcade207a793867797d8f68f Mon Sep 17 00:00:00 2001 From: stephan Date: Thu, 11 Jul 2024 12:57:58 +0000 Subject: [PATCH] Add some docs explaining [64f4f3cd878b1a72]. FossilOrigin-Name: 4fdf9a322fccf7d68b03d07a42a526f18f951e2e19228b7d41e01121b667cc86 --- ext/wasm/api/sqlite3-vfs-opfs.c-pp.js | 18 +++++++++++++++--- manifest | 15 ++++++--------- manifest.uuid | 2 +- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js b/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js index da556224a6..a5af548faa 100644 --- a/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js +++ b/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js @@ -471,10 +471,22 @@ const installOpfsVfs = function callee(options){ /* async thread will take over here */; const t = performance.now(); while('not-equal'!==Atomics.wait(state.sabOPView, state.opIds.rc, -1)){ - /* See discussion at https://github.com/sqlite/sqlite-wasm/issues/12 */ + /* + The reason for this loop is burried in the details of + a long discussion at: + + https://github.com/sqlite/sqlite-wasm/issues/12 + + Summary: in at least one browser flavor, under high loads, + this wait() call can, on rare occasion, end up returning + 'ok', which indicates that it's returning _without_ the + other half of the proxy having called Atomics.notify(). When + this happens, we just wait() again. + */ } - /* When this wait() call returns, the async half will have - completed the operation and reported its results. */; + /* When the above wait() call returns 'not-equal', the async + half will have completed the operation and reported its results + in the state.opIds.rc slot of the SAB. */ const rc = Atomics.load(state.sabOPView, state.opIds.rc); metrics[op].wait += performance.now() - t; if(rc && state.asyncS11nExceptions){ diff --git a/manifest b/manifest index 5f957dd3c4..bc736fbdec 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Proposed\sworkaround\sfor\sthe\s"errant\sop"\scase\sin\sthe\sOPFS\sVFS,\sas\sdiscussed\sin\s[https://github.com/sqlite/sqlite-wasm/issues/12\s|\sissue\s#12\sof\sthe\snpm\sdistribution]. -D 2024-07-11T12:36:28.840 +C Add\ssome\sdocs\sexplaining\s[64f4f3cd878b1a72]. +D 2024-07-11T12:57:58.720 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -619,7 +619,7 @@ F ext/wasm/api/sqlite3-license-version-header.js 0c807a421f0187e778dc1078f10d299 F ext/wasm/api/sqlite3-opfs-async-proxy.js 881af4643f037b6590c491cef5fac8bcdd4118993197a1fa222ccb8b01e3504a F ext/wasm/api/sqlite3-vfs-helper.c-pp.js 3f828cc66758acb40e9c5b4dcfd87fd478a14c8fb7f0630264e6c7fa0e57515d F ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js 8433ee332d5f5e39fb19427fccb7bad7f44aa99b5504daad3343fc128c311e78 -F ext/wasm/api/sqlite3-vfs-opfs.c-pp.js 594b977dd78b0f1908acb21c8dcd29484182a243c5c43ecc4ca381a0a957c046 +F ext/wasm/api/sqlite3-vfs-opfs.c-pp.js 1d0a2d9d9c8b1eb0126e1abd00ef26a9be9d348786d7e415556ecc345832eabe F ext/wasm/api/sqlite3-vtab-helper.c-pp.js a2fcbc3fecdd0eea229283584ebc122f29d98194083675dbe5cb2cf3a17fe309 F ext/wasm/api/sqlite3-wasm.c 9267174b9b0591b4f71193542ab57adf95bb9415f7d3453acf4a8ca8052f5e6c F ext/wasm/api/sqlite3-worker1-promiser.c-pp.js 46f303ba8ddd1b2f0a391798837beddfa72e8c897038c8047eda49ce7d5ed46b @@ -2195,11 +2195,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P bcef3f71a2f68768819d9f716f2c29e752fb173df1506469c8669d95ecc2ff50 -R 6ee8d5e65620ff8ee09c10bb2590f6a1 -T *branch * opfs-errant-op -T *sym-opfs-errant-op * -T -sym-trunk * Cancelled\sby\sbranch. +P 64f4f3cd878b1a723caa0cd54b21f10fdb27d4e2ecb19fc233cbc8dd9d06f259 +R 14a1d62c6182eceaa22bb6feac58e8ac U stephan -Z d907f5fbcee0cc87b9f95edf029b0756 +Z d0a56f821b38fd7e590974af97a06665 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 60a129ff46..df72f89949 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -64f4f3cd878b1a723caa0cd54b21f10fdb27d4e2ecb19fc233cbc8dd9d06f259 +4fdf9a322fccf7d68b03d07a42a526f18f951e2e19228b7d41e01121b667cc86 -- 2.47.2