Services.clearData.deleteDataFromBaseDomain evicts unrelated cache entry
Categories
(Core :: Networking: Cache, defect, P2)
Tracking
()
People
(Reporter: 6k64x4ma, Assigned: emz)
References
(Blocks 1 open bug)
Details
(Whiteboard: [necko-triaged])
Attachments
(4 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:120.0) Gecko/20100101 Firefox/120.0
Steps to reproduce:
- Launch Firefox with a new profile.
- Set
devtools.chrome.enabled
to true. - Browse for a while to add cache files (e.g. go to https://www.mozilla.org/en-US/firefox/developer/).
- Load about:cache.
- Run this snippet in the Browser Console.
Services.clearData.deleteDataFromBaseDomain(
"test.invalid",
false,
Services.clearData.CLEAR_NETWORK_CACHE,
{ onDataDeleted: flags => console.log(flags) }
);
- Wait until the process is complete.
- Duplicate about:cache and compare the two.
Actual results:
- Many cache entries are evicted.
Expected results:
- No cache entries should be evicted since there are no entries loaded from test.invalid.
Regression window:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=9b2ffc8e850587f349301559d397a384ef5c7508&tochange=b9a82200b994f1d8c24f4cc2881b01f245c82757
Updated•1 year ago
|
Updated•1 year ago
|
Comment 1•1 year ago
|
||
I was able to reproduce this and am moving it to the correct component
Comment 2•1 year ago
|
||
I can't reproduce.
Reporter, could you try to record a http log for this?
Please set MOZ_LOG
to timestamp,cache2:5
and also use a clean profile to reproduce.
Thanks.
Here you are. I recorded this using Nightly (Build ID: 20231116093942).
Comment 4•1 year ago
|
||
Thanks for the log.
It appears that when Services.clearData.deleteDataFromBaseDomain
is called, we call clearBaseDomain. In clearBaseDomain
, CacheFileIOManager::EvictByContext will be called with an empty origin and a base domain. Then, at the end of the function EvictByContextInternal
, we create CacheFileContextEvictor to evict entries. Note that in CacheFileContextEvictor
, the base domain is not used to check if the entry should be removed. This seems to be the root cause of this bug.
Assignee | ||
Updated•22 days ago
|
Assignee | ||
Comment 5•21 days ago
|
||
Assignee | ||
Comment 6•20 days ago
|
||
Updated•16 days ago
|
Updated•16 days ago
|
Assignee | ||
Comment 7•16 days ago
|
||
Comment 9•12 days ago
|
||
Backed out for causing failures at test_cache2-33-clear-base-domain.js.
Backout link: https://hg.mozilla.org/integration/autoland/rev/709aef2930d7de7f22e3f3543dba5e7796b27643
Failure log: https://treeherder.mozilla.org/logviewer?job_id=494966481&repo=autoland&lineNumber=4032
Assignee | ||
Updated•12 days ago
|
Comment 10•12 days ago
|
||
Comment 11•12 days ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/6c9a9c3a815c
https://hg.mozilla.org/mozilla-central/rev/ff1d529f6ca5
https://hg.mozilla.org/mozilla-central/rev/cbbeb9a286aa
Assignee | ||
Updated•9 days ago
|
Description
•