Open Bug 1839340 Opened 2 years ago Updated 9 days ago

Have the cache send a notification when it is done clearing

Categories

(Core :: Networking: Cache, defect, P2)

defect

Tracking

()

ASSIGNED

People

(Reporter: h.sofie.p, Assigned: emz)

References

Details

(Whiteboard: [necko-triaged])

Attachments

(1 file)

Right now the clearDataService assumes that the cache is cleared once we have called Services.cache2.clear*() method and the call returned or the promise resolved. This is not necessarily the case, since the work is delegated to a thread here and the clearDataService does not know when that work is done.
We need a notification from the cache, that we can then wait for in the networkCacheCleaner, to properly wait for the cache to be cleared.
This test is failing intermittently due to this. I can fix it by actively waiting for the cache to be cleared but this should only be temporarily, once the cache gives notice that the clearing is finished, the test should not need the band aid anymore.

See Also: → 1760078
Severity: -- → S3
Priority: -- → P2
Whiteboard: [necko-triaged]
Blocks: 1846494
See Also: → 1978545

Add an optional nsICacheEntryDoomCallback parameter to the four clearing methods
on nsICacheStorageService. The callback is threaded through CacheStorageService
into CacheFileIOManager::EvictByContext, which dispatches it back to the main
thread after IO-thread eviction completes. A BarrierCallback helper aggregates
callbacks for methods that fan out into multiple sub-operations.

NetworkCacheCleaner now resolves its promises from the doom callback, and the
waitForCacheClearing polling workaround in test_network_cache.js is removed.

Assignee: nobody → emz
Status: NEW → ASSIGNED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: