Closed Bug 342454 Opened 18 years ago Closed 18 years ago

SessionStore timer loop

Categories

(Firefox :: Session Restore, defect)

defect
Not set
minor

Tracking

()

VERIFIED FIXED
Firefox 2 beta2

People

(Reporter: zeniko, Assigned: zeniko)

Details

(Keywords: fixed1.8.1)

Attachments

(1 file)

It occasionally happens that the timer fires a little too early, leading to an unnecessary timer loop which doesn't stop until the originally intended time interval is reached.
The call to saveStateDelayed is unneeded, since the timer is guaranteed to not fire more often than the specified interval (no more than one timer possible and an interval verification before setting the timer).
Attachment #226700 - Flags: review?(mconnor)
Attachment #226700 - Flags: review?(mconnor) → review?(dietrich)
Comment on attachment 226700 [details] [diff] [review]
always save when the timer is fired

Tested, looks good.
Attachment #226700 - Flags: review?(dietrich) → review+
Whiteboard: [checkin needed]
Target Milestone: --- → Firefox 2 beta2
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Attachment #226700 - Flags: approval1.8.1?
Could you give us a little more information about what this is fixing, how serious that is, and how risky the patch is?
(In reply to comment #3)
> Could you give us a little more information about what this is fixing, how
> serious that is, and how risky the patch is?
> 

I apologize for not explaining when asking for 1.8.1 approval.
 
What this is fixing: The timer enforces a minimum time interval between the saving of session data to disk. When the timer fires, there is no need to evaluate whether that interval has passed or not, as that was decided when the timer was set. However, by re-evaluating at that time, it is possible for the timer to be reset for a short period instead of saving, thereby delaying the save unnecessarily.

How serious it is: Now that the user has the expectation that their session can be restored, this could be considered a data-loss issue. If a crash occurs after the extra timer loop starts, then any session state changes during the extra loop would not be saved, and therefore not restored.

How risky the patch is: Low. Session data is saved to disk slightly more often than before.
This is really just a zero-risk code path clean up which - as Dietrich explained - omits one unnecessary check which could occasionally lead to a millisecond timer being set several times in short succession.

I originally suspected this timer loop to be responsible for occasional dataloss, but it's probably just a benign annoyance while debugging SessionStore's timer code.
Whiteboard: [checkin needed]
Comment on attachment 226700 [details] [diff] [review]
always save when the timer is fired

Thanks for the more detailed explanation.  Approved for drivers.
Attachment #226700 - Flags: approval1.8.1? → approval1.8.1+
Whiteboard: [checkin needed (1.8 branch)]
Keywords: fixed1.8.1
Whiteboard: [checkin needed (1.8 branch)]
Verified using Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1b2) Gecko/20060828 BonEcho/2.0b2 ID:2006082803.
Status: RESOLVED → VERIFIED
Component: General → Session Restore
QA Contact: general → session.restore
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: