Open Bug 1997495 Opened 11 months ago Updated 5 months ago

Race condition when clearing cache data via Clear-Site-Data

Categories

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

defect

Tracking

()

People

(Reporter: jesup, Assigned: jesup, NeedInfo)

References

(Blocks 1 open bug)

Details

(Whiteboard: [necko-triaged])

Attachments

(1 file)

Right now Clear-Site-Data: cache has a race condition vs the spec -- because it does a dispatch from MainThread to the Cache IO thread that actually selects entries for eviction (and we can slightly defer when this runs as well), there's a small window where files may not be actually cleared, or where a file that was added after Clear-Site-Data ran on MainThread can be purged.
This bites CompressionDictionary support, which gets called directly to clear dictionaries for the site (to avoid races there), but can end up with a dictionary registered after Clear-Site-Data getting evicted. This can break WPT tests if the timing is just wrong.

Solve this by adding a creation time, and verify that any file we event was created before the time we started the eviction on MainThread

Blocks: 1997497

The spec requires we clear the cache synchronously, effectively.

Severity: -- → S3
Priority: -- → P2
Whiteboard: [necko-triaged]
Blocks: compression-dictionary
No longer blocks: 1978495, 1997497
Depends on: 1978495, 1997497
Flags: needinfo?(valentin.gosu)
Flags: needinfo?(rjesup)
Flags: needinfo?(valentin.gosu)
You need to log in before you can comment on or make changes to this bug.