Bug 1919507 - Cache: Allow completion of pending actions in Context::OnQuotaInit when the context was canceled; r=dom-storage-reviewers,asuth

Cache implementation already handles directory locks invalidated during
database initialization, but test_slowDatabaseInitialization.js still hangs.
The issue is that Context::CancelAll currently just clears all pending actions
if the state is STATE_CONTEXT_INIT (the promise for caches.open is never
resolved or rejected). Instead of just clearing pending actions, the pending
actions need to be completed first when QuotaInitRunnable is done and only then
cleared.

Differential Revision: https://phabricator.services.mozilla.com/D220263
This commit is contained in:
Jan Varga
2024-10-02 10:34:27 +00:00
parent 7c17884e4b
commit 34dd53e84c
2 changed files with 4 additions and 2 deletions

View File

@@ -912,7 +912,10 @@ void Context::CancelAll() {
}
mState = STATE_CONTEXT_CANCELED;
mPendingActions.Clear();
// Allow completion of pending actions in Context::OnQuotaInit
if (!mInitRunnable) {
mPendingActions.Clear();
}
for (const auto& activity : mActivityList.ForwardRange()) {
activity->Cancel();
}

View File

@@ -25,6 +25,5 @@ skip-if = ["true"]
["test_schema_26_upgrade.js"]
["test_slowDatabaseInitialization.js"]
skip-if = ["true"]
["test_slowStorageInitialization.js"]