Closed Bug 830489 Opened 11 years ago Closed 11 years ago

Delay database initialization and/or opening

Categories

(Firefox Health Report Graveyard :: Client: Desktop, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 21

People

(Reporter: gps, Assigned: gps)

References

Details

Attachments

(1 file, 1 obsolete file)

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
Attached patch Delay DB init on first run, v1 (obsolete) — Splinter Review
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
Status: NEW → ASSIGNED
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+
https://hg.mozilla.org/mozilla-central/rev/42abb7556fd9
Status: ASSIGNED → RESOLVED
Closed: 11 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.

Attachment

General

Created:
Updated:
Size: