Closed Bug 843816 Opened 12 years ago Closed 12 years ago

Detect duplicate sessions

Categories

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

defect
Not set
normal

Tracking

(firefox20 unaffected, firefox21+ verified, firefox22 verified)

VERIFIED FIXED
Firefox 22
Tracking Status
firefox20 --- unaffected
firefox21 + verified
firefox22 --- verified

People

(Reporter: gps, Assigned: gps)

References

Details

Attachments

(1 file)

Investigation in bug 842824 revealed we could perform duplicate session recording in FHR. This bug tracks just that issue. The attached patch should fix the issue. While I changed the behavior of getState() and setState(), I audited the code base for existing consumers and nothing appears to be impacted.
Attachment #716773 - Flags: review?(rnewman)
Comment on attachment 716773 [details] [diff] [review] Detect duplicate sessions, v1 Review of attachment 716773 [details] [diff] [review]: ----------------------------------------------------------------- ::: services/healthreport/providers.jsm @@ +501,5 @@ > this._log.debug("Found " + Object.keys(sessions).length + " previous sessions."); > > let daily = this.getMeasurement("previous", 3); > > + let lastRecordedSession = yield this.getState("lastSession"); There's a coupling between prunedIndex and lastSession. If one of these gets changed and not the other, we'll stop recording sessions for some period of time. Please note this in a comment, and consider whether you want to use a sentinel default value for prunedIndex to know if you ought to reset lastSession. ::: services/healthreport/tests/xpcshell/test_provider_sessions.js @@ +164,5 @@ > + > + // If we try to insert a lower-numbered session, it will be ignored. > + let recorder3 = new SessionRecorder("testing.collect.sessions."); > + recorder3._currentIndex = 2; > + recorder3._prunedIndex = recorder3._currentIndex; I would rather you achieve this by swapping in a copy of the internal state of recorder2 prior to flushing, which more closely mirrors the real-life behavior. ::: services/metrics/dataprovider.jsm @@ +664,5 @@ > > /** > * Obtain persisted provider state. > * > + * Provider state consists of key-value pairs of strings names and values. s/strings/string @@ +686,5 @@ > > + /** > + * Set state for this provider. > + * > + * This is the complementary API for `getState`. … and obeys the same restrictions on storage use.
Attachment #716773 - Flags: review?(rnewman) → review+
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla22
Comment on attachment 716773 [details] [diff] [review] Detect duplicate sessions, v1 [Approval Request Comment] Bug caused by (feature/regressing bug #): Firefox Health Report User impact if declined: Crashes or lack of prefs save on shutdown may cause explosive growth of FHR data. Testing completed (on m-c, etc.): None yet. Should let this bake for a few days first. Risk to taking this patch (and alternatives if risky): Code is contained to JS in FHR. Should be very low risk. String or UUID changes made by this patch: None
Attachment #716773 - Flags: approval-mozilla-aurora?
Nom tracking-21 for baking.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Comment on attachment 716773 [details] [diff] [review] Detect duplicate sessions, v1 Low risk change preventing one possible case of FHR-caused instability.
Attachment #716773 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
This seems to be working okay. I'm not seeing any explosive growth in my FHR data after forcing some restarts and triggering some crashes. I'm not seeing any degradation in stability either. I'm marking this verified fixed but I'll continue to track it as we move up to Beta in case something arises.
Status: RESOLVED → VERIFIED
Component: Metrics and Firefox Health Report → Client: Desktop
Product: Mozilla Services → Firefox Health Report
Target Milestone: mozilla22 → Firefox 22
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: