Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e8f6a9f2b5061ee98a44656cf99995ce9093d47e
      
https://github.com/WebKit/WebKit/commit/e8f6a9f2b5061ee98a44656cf99995ce9093d47e
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-09-21 (Mon, 21 Sep 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/resources/transaction-inflight-worker-terminate-worker.js
    A 
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-inflight-worker-terminate.window-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-inflight-worker-terminate.window.html
    A 
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-inflight-worker-terminate.window.js
    M Source/WebCore/Modules/indexeddb/IDBDatabase.cpp

  Log Message:
  -----------
  Ending a Worker with a readwrite and a readonly IndexedDB transaction in 
flight leaves that database permanently unable to run any transaction
https://bugs.webkit.org/show_bug.cgi?id=324094
rdar://187349025

Reviewed by Sihui Liu.

When a dedicated worker ends while holding both a readwrite and a readonly
transaction in flight on the same database, that database could be left unable
to run any transaction: open() keeps succeeding, but every later transaction
hangs forever with no complete, abort, or error, and does not recover across
reloads or new tabs.

The server only releases a connection (aborting its in-flight transactions and
freeing the object-store scheduling scopes) when it receives
databaseConnectionClosed. On the client, IDBDatabase::stop() closed the
connection only via close() -> maybeCloseInServer(), which withholds that
message while any transaction is still committing or active. Once the context is
stopped those transactions never complete on this thread, so the message is
never sent, and the destructor safety net is defeated by the reference cycle
between IDBDatabase and the stranded transaction. The server thus keeps the
connection and its readwrite transaction in progress forever; since the SQLite
backing store serializes read-writes, that one orphan blocks every subsequent
transaction on the database.

Fix this by having IDBDatabase::stop() close the connection in the server
unconditionally, since no transaction can complete after the context is stopped.

Test: 
imported/w3c/web-platform-tests/IndexedDB/transaction-inflight-worker-terminate.window.html

* 
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/resources/transaction-inflight-worker-terminate-worker.js:
 Added.
(openDatabase):
(writeForEver):
(self.onmessage.async event):
* 
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-inflight-worker-terminate.window-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-inflight-worker-terminate.window.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-inflight-worker-terminate.window.js:
 Added.
(openDatabase):
(async runIteration):
* Source/WebCore/Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::stop):

Canonical link: https://commits.webkit.org/321564@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to