NEW251203
IndexedDB requests occasionally fail with no error, freezing browser
https://bugs.webkit.org/show_bug.cgi?id=251203
Summary IndexedDB requests occasionally fail with no error, freezing browser
goldwaving
Reported 2023-01-26 05:16:33 PST
We are noticing consistent failures when making requests in IndexedDB storage in web workers. It causes a freeze. In some cases it prevents the tab from closing. In rare cases Safari itself cannot be closed and must be force closed. The problem occurs when using IDBObjectStore.get request. Neither onsuccess nor onerror callbacks occur on the request. No callbacks occurs on the transaction. No errors are indicated. When enclosed in a promise, the promise never resolves and 'await' freezes the tab. It seems as if IndexedDB is deadlocked. If we add a setTimeout to reject the promise after some time, the freeze is avoided. Curiously the request then has a 'done' readyState shortly after, so we know that the request is valid and correct. Without the timeout, readyState never becomes done, despite a valid request. This issue does not occur on Chrome or Firefox with exactly the same code. The request resolves as it should. Further information is difficult to gather because the JS Console is too slow and deadlocks as well. We are using emscripten with threads. Our theory is if the main thread is waiting on another thread and that thread is waiting on a request, a deadlock occurs in IndexedDB. This only occurs with webkit. IndexedDB should not depend on the main thread to complete requests.
Attachments
Radar WebKit Bug Importer
Comment 1 2023-02-02 05:17:18 PST
Note You need to log in before you can comment on or make changes to this bug.