Closed Bug 743635 Opened 13 years ago Closed 13 years ago

B2G SMS database initialization accesses Directory Provider off the main thread

Categories

(Core :: DOM: Device Interfaces, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla14

People

(Reporter: philikon, Assigned: philikon)

References

Details

Attachments

(1 file, 1 obsolete file)

On Gonk ICS we're seeing an interesting race condition in the emulator: the B2G SMS database service is initialized at startup and immediately initializes an IndexedDB instance. IndexedDB happens to query the Directory Service for ProfD *off the main thread*. This usually works out fine so long as the Directory Service's cache has been primed (e.g. something has already queried for ProfD). In this case, however, we're seeing that the IndexedDB thread is racing the main thread and fails to look up ProfD.
Attached patch v1 (obsolete) — Splinter Review
Assignee: nobody → philipp
Attachment #613261 - Flags: review?(mwu)
E/GeckoConsole( 108): Attempt to use JS function on a different thread calling nsIDirectoryServiceProvider.getFile. JS objects may not be shared across threads
Attachment #613261 - Flags: review?(mwu) → review+
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla14
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attached patch v2Splinter Review
Now with the proper Services.jsm import. The missing import was preventing the SmsDatabaseService from initializing the database, so it kind of fixed the freezing problem, but not in a very useful way. mwu, would you mind testing this new patch with the missing import added, to see if it still fixes the problem?
Attachment #613261 - Attachment is obsolete: true
Attachment #613832 - Flags: feedback?(mwu)
Turns out, the provided patch doesn't fix the freeze, but it *does* fix the off-thread error. So I'm morphing this bug to just deal with that and filed the cloned bug 744300 to deal with the freeze.
Summary: B2G SMS database initialization freezes I/O thread → B2G SMS database initialization accesses Directory Provider off the main thread
Comment on attachment 613832 [details] [diff] [review] v2 (Canceling feedback request, got feedback from mwu over IRC. Will commit this patch as it already has r+.)
Attachment #613832 - Flags: feedback?(mwu)
Status: REOPENED → RESOLVED
Closed: 13 years ago13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: