Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: d910c7f32672e2ddc0a508253c5823f582ef2f00
https://github.com/WebKit/WebKit/commit/d910c7f32672e2ddc0a508253c5823f582ef2f00
Author: sherwinski <[email protected]>
Date: 2026-06-22 (Mon, 22 Jun 2026)
Changed paths:
M Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp
M Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h
M Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp
M Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h
M Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp
M Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.h
M Source/WebKit/NetworkProcess/NetworkProcess.cpp
M Source/WebKit/NetworkProcess/NetworkProcess.h
M Source/WebKit/NetworkProcess/NetworkProcess.messages.in
M Source/WebKit/NetworkProcess/storage/IDBStorageRegistry.cpp
M Source/WebKit/NetworkProcess/storage/IDBStorageRegistry.h
M Source/WebKit/NetworkProcess/storage/NetworkStorageManager.cpp
M Source/WebKit/NetworkProcess/storage/NetworkStorageManager.h
M Source/WebKit/UIProcess/WebProcessProxy.cpp
M Source/WebKit/UIProcess/WebProcessProxy.h
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/IndexedDBSuspendImminently.mm
Log Message:
-----------
IndexedDB transactions of a suspended process block other processes
indefinitely
https://bugs.webkit.org/show_bug.cgi?id=315804
Reviewed by Sihui Liu.
When a WebContent or service worker process is suspended by the system (for
example in an iOS home screen web app), its in-progress IndexedDB transactions
are never committed or aborted: commits are client-driven, suspension is not a
connection close, and the IDB server has no inactivity timeout. Because the
SQLite backing store serializes read-write transactions, every transaction from
other processes on the same database then queues behind the suspended client's
transaction until the suspended process is killed, which can take over 30
minutes.
Notify the network process when a web process's throttle state crosses the
suspension boundary, and record that state on the matching
IDBConnectionToClient.
When transaction scheduling in UniqueIDBDatabase cannot start a pending
transaction, abort in-progress transactions that belong to suspended clients and
actually block a pending transaction, reusing the suspension-abort result
machinery that network process suspension already uses. Uncontended transactions
of suspended clients are left untouched, so the existing behavior of resuming
them on process resume is preserved. Aborting an in-progress versionchange
transaction rolls back the in-memory database info and clears the version-change
connection, matching the standard abort path.
The aborted transaction object stays in its connection's transaction map, so a
client that later resumes learns about the abort through the stored suspension
abort result when it next aborts or commits, and the entry is dropped on
connection close otherwise.
* Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp:
(WebCore::IDBServer::IDBConnectionToClient::setClientProcessSuspended):
* Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h:
* Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::clearTransactionsOnConnection):
(WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::handleTransactions):
(WebCore::IDBServer::UniqueIDBDatabase::transactionBlocksPendingTransactions):
(WebCore::IDBServer::UniqueIDBDatabase::abortInProgressTransactionsBlockedOnSuspendedClients):
* Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h:
* Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseConnection::deleteTransactionsAbortedForClientSuspension):
* Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
* Source/WebKit/NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::setWebProcessSuspended):
* Source/WebKit/NetworkProcess/NetworkProcess.h:
* Source/WebKit/NetworkProcess/NetworkProcess.messages.in:
* Source/WebKit/NetworkProcess/storage/IDBStorageRegistry.cpp:
(WebKit::IDBStorageRegistry::existingConnectionToClient):
* Source/WebKit/NetworkProcess/storage/IDBStorageRegistry.h:
* Source/WebKit/NetworkProcess/storage/NetworkStorageManager.cpp:
(WebKit::NetworkStorageManager::setWebProcessSuspended):
* Source/WebKit/NetworkProcess/storage/NetworkStorageManager.h:
* Source/WebKit/UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didChangeThrottleState):
* Source/WebKit/UIProcess/WebProcessProxy.h:
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/IndexedDBSuspendImminently.mm:
(TEST(IndexedDB, TransactionOfSuspendedProcessDoesNotBlockOtherProcesses)):
(TEST(IndexedDB,
ReadOnlyTransactionOfSuspendedProcessDoesNotBlockOtherProcesses)):
(TEST(IndexedDB, UncontendedTransactionOfSuspendedProcessIsNotAborted)):
Canonical link: https://commits.webkit.org/315609@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications