When the site usage is near its quota, Cache.delete() sometimes fails with a quota error
Categories
(Core :: Storage: Quota Manager, defect, P3)
Tracking
()
People
(Reporter: cpnspam+git, Unassigned)
References
Details
(Whiteboard: dom-lws-bugdash-triage)
Steps to reproduce:
I don't know if a service worker is necessary, but my code is doing the following actions in a service worker.
It stores a few MB of data to an object store in indexedDB and a couple of GB of data (for testing purposes) to a cache. (Non-persistent storage is used for this test since persistent storage always reports 0 usage.)
When a cache write fails with NS_ERROR_FILE_NO_DEVICE_SPACE, it uses Cache.delete() to delete selected URLs from the cache to try to free up some space.
Actual results:
About 10-20% of the time (probably depending on the exact usage), the Cache.delete() promise is rejected with an NS_ERROR_FILE_NO_DEVICE_SPACE error, and the cache entry is not deleted.
Expected results:
Being near or over quota should not prevent a delete from completing. If delete doesn't work, there is no way for the service worker to recover.
Reporter | ||
Updated•4 years ago
|
Reporter | ||
Comment 1•4 years ago
|
||
Unlike in bug 1674325, waiting 5 seconds and attempting to delete again never seems to work.
Comment 2•4 years ago
|
||
Simon, could you please take a look over this when you get a chance?
Seems to be similar with bug 1674325.
Thanks!
Comment 3•4 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Updated•3 years ago
|
Updated•3 years ago
|
Updated•1 month ago
|
Comment 4•1 month ago
|
||
This is a simpler situation than bug 1674325 where the SQLite transaction would be scoped only to deletion and we can allow temporary relaxation of the storage constrains via (this is currently IDB-specific code, but can be used by Cache) DisableQuotaChecks like IDB [does for its cleanup transaction mechanism](https://searchfox.org/mozilla-central/rev/d3fea1aa852bb3a353a0a4a875c3685da11ce39b/dom/indexedDB/ActorsParent.cpp#96470. We might want to make sure that we checkpoint/similar.
Description
•