Closed
Bug 1150691
Opened 10 years ago
Closed 10 years ago
Cache Context close can race with storage invalidation
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla40
Tracking | Status | |
---|---|---|
firefox40 | --- | fixed |
People
(Reporter: bkelly, Assigned: bkelly)
References
Details
Attachments
(1 file)
4.55 KB,
patch
|
ehsan.akhgari
:
review+
|
Details | Diff | Splinter Review |
While working on bug 1110485 I discovered that there is a way for QuotaManager to clear storage without the Cache Manager getting marked as invalid:
1) Manager calls Context::AllowToClose() because it thinks its idle.
2) Context is released and destroyed on background thread.
3) Context schedules a runnable to release OfflineStorage on main thread.
4) QM invalidates OfflineStorage on main thread.
5) OfflineStorage tries to invalidate Context, but its already gone.
6) OfflineStorage is desotryed when runnable from step (3) runs.
Also, the Manager is currently a bit sloppy in its determination of idle. Right now it just checks for Listener objects, but it should also look at CacheId and BodyId references.
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → bkelly
Status: NEW → ASSIGNED
Assignee | ||
Comment 1•10 years ago
|
||
Attachment #8587649 -
Flags: review?(ehsan)
Assignee | ||
Comment 2•10 years ago
|
||
I guess I should add a comment somewhere that you must do one of the following to keep your Manager reference valid:
1) Add yourself as a listener by performing an op on the Manager
2) Call AddRefCacheId
3) Call AddRefBodyId
All current consumers do this, but it may not be obvious.
Alternatively, I could switch the "Manager is idle" check to a custom Release() method. I don't really want to do that, though.
Comment 3•10 years ago
|
||
Comment on attachment 8587649 [details] [diff] [review]
Fix Cache API race with storage invalidation. r=ehsan
Review of attachment 8587649 [details] [diff] [review]:
-----------------------------------------------------------------
It would be lovely if you can add comment 2 somewhere in the code.
Attachment #8587649 -
Flags: review?(ehsan) → review+
Assignee | ||
Comment 4•10 years ago
|
||
Landed with added comment:
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/403400998055
Comment 5•10 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
status-firefox40:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•