Delay database initialization and/or opening

RESOLVED FIXED in Firefox 21


7 years ago
10 months ago


(Reporter: gps, Assigned: gps)


Firefox 21
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)



(1 attachment, 1 obsolete attachment)

Per discussions with Perf team, we should consider delaying the following:

1) Initial database creation on first run
2) Opening the database on every application run
Blocks: 828152
Depends on: 830490
We will now delay FHR loading the first time the profile is used by 60s instead of the default 10s.

This only addresses half of the bug but half is better than none. We can file a follow-up to deal with remaining issues.
Assignee: nobody → gps
Attachment #710436 - Flags: review?(rnewman)
Comment on attachment 710436 [details] [diff] [review]
Delay DB init on first run, v1

Review of attachment 710436 [details] [diff] [review]:

::: services/datareporting/DataReportingService.js
@@ +148,1 @@
>                              DEFAULT_LOAD_DELAY_MSEC;

Fix indent.

@@ +148,4 @@
>                              DEFAULT_LOAD_DELAY_MSEC;
> +        } else {
> +          delayInterval = this._prefs.get("service.loadDelayFirstRunMsec") ||
> +                            DEFAULT_LOAD_DELAY_FIRST_RUN_MSEC;

Fix indent.

@@ +252,5 @@
>                                                   this.policy,
>                                                   this.sessionRecorder);
> +
> +    // Record first run so subsequent service loads aren't as delayed.
> +    this._prefs.set("service.firstRun", true);

Observation: HealthReporter inits in the background, so it's quite possible that they quit before initialization has finished. That is, if I quit after 61 seconds, firstRun = true, but the DB has not finished initializing, and it'll happen after ten seconds next time.

IMO this isn't a big enough issue to warrant setting firstRun within HealthReporter, but it's worth calling out explicitly (if only in a bug comment!).
Attachment #710436 - Flags: review?(rnewman) → review+
We have an onInit promise. We should use it.
Attachment #710436 - Attachment is obsolete: true
Attachment #710501 - Flags: review?(rnewman)
Attachment #710501 - Flags: review?(rnewman) → review+
Closed: 7 years ago
Resolution: --- → FIXED
Whiteboard: [fixed in services]
Target Milestone: --- → mozilla21
Component: Metrics and Firefox Health Report → Client: Desktop
Product: Mozilla Services → Firefox Health Report
Target Milestone: mozilla21 → Firefox 21
Product: Firefox Health Report → Firefox Health Report Graveyard
You need to log in before you can comment on or make changes to this bug.