Closed Bug 832677 Opened 8 years ago Closed 8 years ago

Telemetry uses preferences off the main thread (again)

Categories

(Toolkit :: Telemetry, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: khuey, Unassigned)

References

(Blocks 1 open bug)

Details

ConstructTelemetryVFS gets a pref.  If it's called off the main thread, say because the storage service is being initialized off the main thread, lots of sadness happens.

This happens when running TestSettingsAPI.
ConstructTelemetryVFS() is called by Service::initialize, should probably be moved to ServiceMainThreadInitializer and likely a MOZ_ASSERT to check for mainthread in the constructor would be useful (related to that, why doesn't Preferences have any?)
(In reply to Marco Bonardo [:mak] from comment #1)
> ConstructTelemetryVFS() is called by Service::initialize, should probably be
> moved to ServiceMainThreadInitializer and likely a MOZ_ASSERT to check for
> mainthread in the constructor would be useful (related to that, why doesn't
> Preferences have any?)

Because people keep adding new off-main-thread uses before Bug 619487 can be fixed.
Depends on: 798366
I talked with khuey this morning and he says this is the last thing blocking prefs-assert-off-the-main-thread.

AFAICS, however, we can't move the pref accessing in TelemetryVFS off the main thread until bug 836493 is fixed.

We *could* move the pref accessing to mozStorageService's main-thread initialization bits.  But that means we couldn't safely construct the TelemetryVFS until that point, too.  And if we somehow connected to databases before that main-thread initialization completed, we wouldn't be using TelemetryVFS.  And because TelemetryVFS handles database quotas, among other things...well, the failure modes are not pretty.

So that's what we're waiting on here.
I figured out a work around, so this doesn't block bug 619487.  We should still fix this though.
I think bug 836493 has effectively solved this: constructing TelemetryVFS only happens on the first call to Service::initialize, and that call now always happens on the main thread.  Mak, do you agree?
Flags: needinfo?(mak77)
yep!
Status: NEW → RESOLVED
Closed: 8 years ago
Depends on: 836493
Flags: needinfo?(mak77)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.