Bug 309386
| Summary: | [IndexedDB] Recover IndexedDB connections after network process crash without page reload | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Brandon <brandonstewart> |
| Component: | WebCore Misc. | Assignee: | Brandon <brandonstewart> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari 26 | ||
| Hardware: | All | ||
| OS: | All | ||
Brandon
When the NetworkProcess crashes, IndexedDB becomes permanently broken for the
lifetime of the page. Documents and workers cache an IDBConnectionProxy pointing
to a dead IDBConnectionToServer (m_serverConnectionIsValid == false), and the
DOMWindowIndexedDatabase/WorkerGlobalScopeIndexedDatabase supplements cache an
IDBFactory bound to that dead proxy. New indexedDB.open() calls fail with
"Connection to Indexed Database server lost" until the page is reloaded.
Fix this by clearing the stale proxy caches when the network process connection
is lost:
- Document::clearIDBConnectionProxy() nulls m_idbConnectionProxy so the next
idbConnectionProxy() call lazily fetches a fresh proxy from Page::idbConnection(),
and removes the DOMWindowIndexedDatabase supplement so the IDBFactory is recreated.
- Page::clearIDBConnectionOnAllDocuments() clears the page-level IDBConnectionToServer
and all document proxies.
- For workers, Page::refreshIDBConnectionForWorkers() creates a new IDBConnectionToServer
and distributes its proxy to all worker threads via
WorkerGlobalScope::replaceIDBConnectionProxyOnAllWorkers(), which iterates
allWorkerGlobalScopeIdentifiers and posts a task to each worker to replace its
cached proxy and remove its WorkerGlobalScopeIndexedDatabase supplement.
- NetworkProcessConnection::didClose() calls refreshIDBConnectionForWorkers() after
connectionToServerLost() finishes tearing down the old connection, so workers
receive the new proxy after all error notifications from the old connection.
- Supplementable::removeSupplement() is added to support clearing cached supplements.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/171932720>
Brandon
Pull request: https://github.com/WebKit/WebKit/pull/60094
EWS
Committed 309032@main (3c147a650200): <https://commits.webkit.org/309032@main>
Reviewed commits have been landed. Closing PR #60094 and removing active labels.