Cover origin initialization in OpenStorageDirectory and OpenClientDirectory
Categories
(Core :: Storage: Quota Manager, task, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox133 | --- | fixed |
People
(Reporter: janv, Assigned: janv)
References
(Blocks 1 open bug)
Details
Attachments
(31 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
Quota clients and origin operations currently still have to call EnsurePersistentOriginIsInitializedInternal or EnsureTemporaryOriginIsInitializedInternal method on the QM IO thread. This should be covered by OpenStorageDirectory and OpenClientDirectory instead.
| Assignee | ||
Comment 1•1 year ago
|
||
Client storages can be currently cleared by using the optional argument of
nsIQuotaManagerService::ClearStoragesForPrincipal. However, supporting clearing
storages for both a principal and a client is not ideal for several reasons.
Clearing of origins will have to unset some flags which is problematic when
a client type is specified and clearing of clients will eventually need to
unset some other flags as well.
Depends on D195400
| Assignee | ||
Comment 2•1 year ago
|
||
Depends on D195400
| Assignee | ||
Comment 3•1 year ago
|
||
There's now a dedicated nsIQuotaManagerService::ClearStoragesForClient method
for clearing storages by client type. All callers of
nsIQuotaManagerService::ClearStoragesForPrincipal which want to clear storages
for a specific client only can be now converted to call the new method.
Depends on D195403
| Assignee | ||
Comment 4•1 year ago
|
||
Depends on D195504
| Assignee | ||
Comment 5•1 year ago
|
||
A sub actor is no longer created. Actual result is now returned as
an asynchronous response to an asynchronous message.
Depends on D195505
| Assignee | ||
Comment 6•1 year ago
|
||
Client storages can be currently reset by using the optional argument of
nsIQuotaManagerService::ResetStoragesForPrincipal. However, supporting
resetting storages for both a principal and a client is not ideal for several
reasons. Resetting of origins will have to unset some flags which is
problematic when a client type is specified and resetting of clients will
eventually need to unset some other flags as well.
Depends on D195507
| Assignee | ||
Comment 7•1 year ago
|
||
There's now a dedicated nsIQuotaManagerService::ResetStoragesForClient method
for resetting storages by client type. All callers of
nsIQuotaManagerService::ResetStoragesForPrincipal which want to reset storages
for a specific client only can be now converted to call the new method.
Depends on D195508
| Assignee | ||
Comment 8•1 year ago
|
||
Depends on D195509
| Assignee | ||
Comment 9•1 year ago
|
||
This is a preparation for unsetting some flags when origins are either cleared
or reset.
Depends on D195510
| Assignee | ||
Comment 10•1 year ago
|
||
This additional testing infrastructure is needed for verifying origin
initialization status.
Depends on D195522
| Assignee | ||
Comment 11•1 year ago
|
||
This removes some code duplication, but the primary motivation is to use it for
a member variable declaration in QuotaManager.h
Depends on D195526
| Assignee | ||
Comment 12•1 year ago
|
||
Origin initialization tracking on the owning thread is needed for covering
origin initialization in QuotaManager::OpenClientDirectory.
Depends on D195532
| Assignee | ||
Comment 13•1 year ago
|
||
The new category is needed for implementing an optimization in
QuotaManager::InitializePersistentOrigin,
QuotaManager::InitializeTemporaryOrigin and
QuotaManager::OpenClientDirectory to avoid creating a new origin initialization
operations when a given origin is already initialized.
Depends on D195535
| Assignee | ||
Comment 14•1 year ago
|
||
It's now possible to check if an origin is already initialized on the owning
thread and it's also possible to evaluate existing directory locks if there are
any uninit origin operations pending. So we can add optimizations to origin
initialization methods to resolve promises immediately if origins are already
initialized and there are no pending uninit storage or uninit origin operations.
Depends on D195543
| Assignee | ||
Comment 15•1 year ago
|
||
LSNG already uses some QuotaManager APIs to achieve that origin directories are
not created if they don't exist during datastore preparation, but the feature
is not easy to use and it's also not generalized enough for use in other quota
clients. Besides that, the way how it's currently done in LSNG complicates
removal of QuotaManager::EnsureTemporaryOriginIsInitializedInternal calls from
LSNG. This patch is about generalizing of the feature, making it available to
all quota clients.
Depends on D195548
| Assignee | ||
Comment 16•1 year ago
|
||
Depends on D195551
| Assignee | ||
Comment 17•1 year ago
|
||
QuotaManager::OpenClientDirectory can now get initialization status of
corresponding origin and initialize the origin if it's needed.
Depends on D195570
| Assignee | ||
Comment 18•1 year ago
|
||
QuotaManager::OpenClientDirectory already makes sure that corresponding origin
is initialized so all places where a client directory lock is obtained in such
way can start using QuotaManager::GetOrCreateOriginDirectory instead of
QuotaManager::Ensure(Persistent|Temporary)OriginIsInitializedInternal.
Depends on D195582
| Assignee | ||
Comment 19•1 year ago
|
||
IndexedDB still calls QuotaManager::EnsurePersistentOriginIsInitializedInternal
from its idle database maintenance. However, we want to get rid of that so the
method can be made private. The idle database maintenance should only rely on
QuotaManager::OpenStorageDirectory method to do all necessary initialization.
Before we can do that, we need a method dedicated for initialization of entire
persistent storage.
Depends on D195589
| Assignee | ||
Comment 20•1 year ago
|
||
QuotaManager::OpenStorageDirectory can now detect the requested persistence
scope and initialize persistent storage if it's needed.
Depends on D195653
| Assignee | ||
Comment 21•1 year ago
|
||
QuotaManager::OpenStorageDirectory already makes sure that persistent storage
is initialized so this call is now redundant.
Depends on D195661
| Assignee | ||
Comment 22•1 year ago
|
||
QuotaManager::Ensure(Persistent|Temporary)OriginIsInitializedInternal are now
called only from Initialize(Persistent|Temporary)OriginOp. It's now easy to
change the methods to be private methods.
Depends on D195665
| Assignee | ||
Comment 23•1 year ago
|
||
The getter IsExtensionOrigin doesn't require the lock to be held, so the member
must be const.
Depends on D195548
Updated•1 year ago
|
| Assignee | ||
Comment 24•1 year ago
|
||
If temporary storage is already initialized, we can use the cached value and
avoid reading it from the metadata file (which was used for loading the cached
value).
Depends on D196657
| Assignee | ||
Comment 25•1 year ago
|
||
Currently, we call QuotaManager::PersistOrigin even when the origin was already
persisted. QuotaManager::PersistOrigin won't try to update the value again,
but it will have to do a hash lookup. We can easilly avoid this by calling
QuotaManager::PersistOrigin only when the value changed in the metadata file.
Depends on D198664
| Assignee | ||
Comment 26•1 year ago
|
||
Currently, the cached value is updated before creation of the metadata file
which can lead to a mismatch between the metadata file and the cached value if
creation of the metadata file fails. It will be safer to update the cached
value only after successful creation of the metadata file.
Depends on D198668
| Assignee | ||
Comment 27•1 year ago
|
||
| Assignee | ||
Comment 28•1 year ago
|
||
| Assignee | ||
Comment 29•1 year ago
|
||
| Assignee | ||
Comment 30•1 year ago
|
||
| Assignee | ||
Comment 31•1 year ago
|
||
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Updated•1 year ago
|
Comment 32•1 year ago
|
||
Comment 33•1 year ago
|
||
| bugherder | ||
Comment 34•1 year ago
|
||
Comment 35•1 year ago
|
||
| bugherder | ||
Comment 36•1 year ago
|
||
Comment 37•1 year ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/ba51eb2a6d1f
https://hg.mozilla.org/mozilla-central/rev/0afeb47f38b0
https://hg.mozilla.org/mozilla-central/rev/f799f35b1c84
https://hg.mozilla.org/mozilla-central/rev/aaa63956f3f0
https://hg.mozilla.org/mozilla-central/rev/f2254b3d51d9
https://hg.mozilla.org/mozilla-central/rev/e18f8613cd79
https://hg.mozilla.org/mozilla-central/rev/8380179aa33f
https://hg.mozilla.org/mozilla-central/rev/5c07a7c55bf3
https://hg.mozilla.org/mozilla-central/rev/83daa2e3f527
Comment 38•1 year ago
|
||
Comment 39•1 year ago
|
||
| bugherder | ||
Comment 40•1 year ago
|
||
Comment 41•1 year ago
|
||
Backed out the last 7 changesets for causing crashes (Bug 1762908):
https://hg.mozilla.org/mozilla-central/rev/326f317b084883b87bd495f2d1b715bd5bc1be8e
Comment 42•1 year ago
|
||
| Assignee | ||
Comment 43•1 year ago
|
||
(In reply to Sebastian Hengst [:aryx] (needinfo me if it's about an intermittent or backout) from comment #41)
Backed out the last 7 changesets for causing crashes (Bug 1762908):
https://hg.mozilla.org/mozilla-central/rev/326f317b084883b87bd495f2d1b715bd5bc1be8e
Looking ...
So far it seems my try preset is not broad enough.
I don't see any reference to concrete failed tests (nor in bug 1762908), so for now I'm only guessing that one of those failed tests is dom/serviceworkers/test/browser_storage_recovery.js
So I probably need to extend my try preset to avoid backouts like this in future.
| Assignee | ||
Comment 44•1 year ago
|
||
(In reply to Sebastian Hengst [:aryx] (needinfo me if it's about an intermittent or backout) from comment #41)
Backed out the last 7 changesets for causing crashes (Bug 1762908):
https://hg.mozilla.org/mozilla-central/rev/326f317b084883b87bd495f2d1b715bd5bc1be8e
What was the main reason for the backout ?
Crashes on our CI or increased crashes in our crash stats ?
Comment 45•1 year ago
|
||
(In reply to Jan Varga [:janv] from comment #44)
What was the main reason for the backout ?
Crashes on our CI or increased crashes in our crash stats ?
Bug 1762908 is for crashes submitted by users and for [@ mozilla::Maybe<T>::value | mozilla::dom::quota::OriginInfo::LockedDecreaseUsage] it lists 7 crashes from 7 installs for the last Nightly (built during the European night, these builds have lower usage volume than the ones released during the European afternoon).
| Assignee | ||
Comment 46•1 year ago
|
||
Ok, thanks, that's what I needed to know (I already checked crash stats but I needed to be sure). So there's actually no particular existing test, I probably need to check the code and find out which scenario can lead to the crash and eventually create a test for it.
Comment 47•1 year ago
|
||
| bugherder | ||
Comment 48•1 year ago
|
||
Comment 49•1 year ago
|
||
| bugherder | ||
Comment 50•1 year ago
|
||
Comment 51•1 year ago
|
||
| bugherder | ||
Comment 52•1 year ago
|
||
Comment 53•1 year ago
|
||
| bugherder | ||
Comment 54•1 year ago
|
||
Comment 55•1 year ago
|
||
| bugherder | ||
Comment 56•1 year ago
|
||
Comment 57•1 year ago
|
||
| bugherder | ||
Comment 58•1 year ago
|
||
Comment 59•1 year ago
|
||
| Assignee | ||
Updated•1 year ago
|
Comment 60•1 year ago
|
||
| bugherder | ||
Comment 61•1 year ago
|
||
| bugherder | ||
Description
•