New DOMStorage followup: reintroduce bug 842852

RESOLVED FIXED in mozilla23

Status

()

defect
RESOLVED FIXED
7 years ago
5 months ago

People

(Reporter: mayhemer, Assigned: mayhemer)

Tracking

unspecified
mozilla23
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

No description provided.
Actually, apply [1] to the new code.

[1] https://hg.mozilla.org/integration/mozilla-inbound/rev/4b67ec4c0d4e
Posted patch v1Splinter Review
- identical copy of what has been introduced in bug 842852 wrt ConfigureWALBehavior() and how the read-only connection is being open
- reader connection now opened and closed on the worker thread (previously on the main thread, opened lazily)
Attachment #724218 - Flags: review?(mak77)
Comment on attachment 724218 [details] [diff] [review]
v1

Review of attachment 724218 [details] [diff] [review]:
-----------------------------------------------------------------

The patch looks good, but it's hard to figure how it merges with the surroundings, since everything is still in patches.

Could you please tell me what happens after this patch, when the sync preload is needed?  Does the mainthread stop and waits for the async thread to open both the connections, in both WAL and non-WAL mode?
If so, I think it's ok. Opening/closing the sync connection in the async thread looks like a good idea.

::: dom/src/storage/DOMStorageDBThread.cpp
@@ +595,4 @@
>  DOMStorageDBThread::ShutdownDatabase()
>  {
> +  // Has to be called on the worker thread.
> +  MOZ_ASSERT(!NS_IsMainThread());

nit: you may move the comment to a MOZ_ASSERT message (2nd param)
Attachment #724218 - Flags: review?(mak77) → review+
Marco, here is try run for this patch on top of 2.7.1 patch from bug 600307:

https://tbpl.mozilla.org/?tree=Try&rev=b02d595de26d

You can check the whole context now.
Sorry, I forgot to answer your questions!

(In reply to Marco Bonardo [:mak] from comment #3)
> Could you please tell me what happens after this patch, when the sync
> preload is needed?  

I'm not sure I understand the question.  The behavior is identical, with just one difference: when the clone r/o connection is not ready and we demand sync load, it cannot be satisfied directly (there is no connection to do the SELECT on), thus we .

> Does the mainthread stop and waits for the async thread
> to open both the connections, in both WAL and non-WAL mode?

Yes.  But it doesn't wait for opening the connection only, it also waits for the database version sanitization.  If that is not ready, main thread has to wait.  This more or less covers also answer to the first question.
https://hg.mozilla.org/mozilla-central/rev/626f981f90e6
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.