Closed Bug 1542475 Opened 5 years ago Closed 5 years ago

LSNG: Potential double closing of datastores

Categories

(Core :: Storage: localStorage & sessionStorage, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: janv, Assigned: janv)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

No description provided.
Assignee: nobody → jvarga
Blocks: 1540402
Status: NEW → ASSIGNED

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.

Blocks: 1540384
Pushed by jvarga@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/4085f543cfc2
LSNG: Potential double closing of datastores; r=asuth
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: