LSNG: Potential double closing of datastores
Categories
(Core :: Storage: localStorage & sessionStorage, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox68 | --- | fixed |
People
(Reporter: janv, Assigned: janv)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 1•6 years ago
|
||
Assignee | ||
Comment 2•6 years ago
|
||
The double closing can happen when a prepare datastore op obtained datastore via a hash table lookup here:
https://searchfox.org/mozilla-central/rev/8e0ea968308dd692ba5394b14e584234acf7d4ca/dom/localstorage/ActorsParent.cpp#6131
and then the result code was set to an error (probably because actor died) while it was waiting for the finish message.
The current code immediately closes the datastore here:
https://searchfox.org/mozilla-central/rev/8e0ea968308dd692ba5394b14e584234acf7d4ca/dom/localstorage/ActorsParent.cpp#6784
The problem is that the datastore can be already used by something else, for example by live databases. This is confirmed in bug 1541774. Later, a live database will call NoteFinishedDatabase which leads to another Close call.
That's the double close which leads to numerous problems.
The proper solution is to let NoteFinishedPrepareDatastoreOp to call MaybeClose.
We can also speedup closing by destroying prepared datastore created by the prepare datastore op.
Comment 4•6 years ago
|
||
bugherder |
Description
•