Closed Bug 1149980 Opened 5 years ago Closed 5 years ago

Guard |RecordShutdownEndTimeStamp| with |CanRecordExtended|

Categories

(Toolkit :: Telemetry, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla40
Tracking Status
firefox40 --- fixed

People

(Reporter: Dexter, Assigned: Dexter)

References

Details

Attachments

(1 file, 1 obsolete file)

We should investigate why |RecordShutdownEndTimeStamp| is not guarded by |CanRecordExtended|: it only checks that a previous call to |GetShutdownTimeFileName| [2] was made. This made bug 1148763 hard to track down.

We should investigate if this behaviour is fine, and simply make it clearer that we are crashing because |RecordShutdownEndTimeStamp| was not called, or if we should consider guarding |RecordShutdownEndTimeStamp| with |CanRecordExtended|.

[1] - https://hg.mozilla.org/mozilla-central/annotate/18a8ea7c2c62/toolkit/components/telemetry/Telemetry.cpp#l3568
[2] - https://hg.mozilla.org/mozilla-central/annotate/18a8ea7c2c62/toolkit/components/telemetry/Telemetry.cpp#l1684
Blocks: 1122482
Attached patch bug1149980.patch (obsolete) — Splinter Review
This should fix the mochitest issues for bug 1137252 as well.
Attachment #8592927 - Flags: review?(vdjeric)
Comment on attachment 8592927 [details] [diff] [review]
bug1149980.patch

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

::: toolkit/components/telemetry/Telemetry.cpp
@@ +3585,5 @@
>  
> +  if (gRecordedShutdownStartTime.IsNull()) {
> +    // If |CanRecordExtended()| is true before |AsyncFetchTelemetryData| is called and
> +    // then disabled before shutdown, |RecordShutdownStartTimeStamp| will bail out and
> +    // we will end up with an invalid |gRecordedShutdownStartTime| here. This can happen

technically, the start time can end up being null, not invalid
Attachment #8592927 - Flags: review?(vdjeric) → review+
Thanks Vladan, I've changed the comment accordingly.
Assignee: nobody → alessio.placitelli
Attachment #8592927 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #8593017 - Flags: review+
This definitely fixes the intermittent failures from bug 1154154: 

Linux debug bc3 retriggers: https://treeherder.mozilla.org/#/jobs?repo=try&revision=516dc607dfd0
Full try push stacking on bug 1137252: https://treeherder.mozilla.org/#/jobs?repo=try&revision=114653822987
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/873347dd964f
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
You need to log in before you can comment on or make changes to this bug.