Closed Bug 833612 Opened 11 years ago Closed 11 years ago

Session restored time being reported as -1

Categories

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

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED
Firefox 21

People

(Reporter: gps, Assigned: gps)

References

Details

Attachments

(1 file)

I'm seeing this in official Nightly builds on both OS X and Windows. Local builds work fine (at least they did just before I checked bug 827157 in). Not sure what's going on.

FWIW, the -1 comes from the default value when doing a prefs.get(). The underlying problem is the current.sessionRestored pref is not being set.

We really need a mochitest or marionette test for this...
Since apparently nextTick wasn't enough to capture sessionRestored in sessionstore-windows-restored, we now install a recurring timer and attempt to get sessionRestored until it is available.
Assignee: nobody → gps
Status: NEW → ASSIGNED
Attachment #709168 - Flags: review?(rnewman)
Daniel: Can you please confirm that we are seeing sessionRestored == -1 on actual payloads in Nightly?
Flags: needinfo?(deinspanjer)
Harsha, is this something you could dig up out of the latest FHR payloads today?
Flags: needinfo?(deinspanjer) → needinfo?(schintalapani)
Daniel,
   I will work on it.
-Harsha
Flags: needinfo?(schintalapani)
Gregory,
     We have 2000 payloads with org.mozilla.appSessions.current.sessionRestored as -1 out of total 93177 records.
Let me know if you need more info regarding those payloads.

Thanks
Harsha
Comment on attachment 709168 [details] [diff] [review]
More robust collection of sessionRestored, v1

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

::: services/datareporting/sessions.jsm
@@ +206,3 @@
>  
>    recordStartupFields: function () {
>      let si = this._getStartupInfo();

We're now calling recordStartupFields up to 60 times.

getStartupInfo appears to accumulate some telemetry info (e.g., STARTUP_MEASUREMENT_ERRORS). Please make sure with the telemetry folks that potentially accumulating a few dozen times is OK…

@@ +297,5 @@
>  
> +    if (this._timer) {
> +      this._timer.cancel();
> +      delete this._timer;
> +    }

These four lines are repeated twice. Refactor into method?

::: services/datareporting/tests/xpcshell/test_session_recorder.js
@@ +124,5 @@
> +  do_check_null(recorder._timer);
> +  yield sleep(100);
> +  do_check_eq(recordCount, 4);
> +
> +  recorder.onShutdown();

Need a test that shutdown clears the timer, too.
Attachment #709168 - Flags: review?(rnewman)
Attachment #709168 - Flags: review+
Attachment #709168 - Flags: feedback?
Attachment #709168 - Flags: feedback?
Comment on attachment 709168 [details] [diff] [review]
More robust collection of sessionRestored, v1

Could one of you please comment on the effect to Telemetry of calling getStartupInfo() multiple times?

I may land this before feedback is granted. If it makes it to m-c, we can do a follow-up or back out (at worst).
Attachment #709168 - Flags: feedback?(vdjeric)
Attachment #709168 - Flags: feedback?(dteller)
https://hg.mozilla.org/services/services-central/rev/916d0e440c47

With new test and with timer clearing factored into a function.

Will address Telemetry/Perf issue if it is flagged.
Whiteboard: [fixed in services]
https://hg.mozilla.org/mozilla-central/rev/916d0e440c47
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [fixed in services]
Target Milestone: --- → mozilla21
Comment on attachment 709168 [details] [diff] [review]
More robust collection of sessionRestored, v1

Calling getStartupInfo repeatedly won't skew the STARTUP_MEASUREMENT_ERRORS data.

What is causing these startup timestamps to be missing?
Is it that a) the startup timestamp is corrupted or incorrect for whatever reason, or b) the startup event in question hasn't occurred yet when FHR tries to get its timestamp?
Attachment #709168 - Flags: feedback?(vdjeric)
Attachment #709168 - Flags: feedback?(dteller)
Attachment #709168 - Flags: feedback+
(In reply to Vladan Djeric (:vladan) from comment #10)
> What is causing these startup timestamps to be missing?
> b) the startup event in question hasn't occurred yet when FHR
> tries to get its timestamp?

This one. Apparently there is a race condition between the order the observers are registered in or something. It always works for my local builds and apparently works for a number of users in the wild. However, a significant fraction of reports contained -1. So, we had to resort to polling :(
Verifed fixed in Aurora 21.0a2. Marking in-testsuite+ since it appears this patch landed with tests. Please correct me if I am wrong.
Status: RESOLVED → VERIFIED
Flags: in-testsuite+
Component: Metrics and Firefox Health Report → Client: Desktop
Flags: in-testsuite+
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: