Closed
Bug 902280
Opened 11 years ago
Closed 11 years ago
[Session Restore] When invalidating while writing, we end up deceeding the write interval
Categories
(Firefox :: Session Restore, defect)
Firefox
Session Restore
Tracking
()
RESOLVED
FIXED
Firefox 26
People
(Reporter: ttaubert, Assigned: smacleod)
Details
Attachments
(1 file, 1 obsolete file)
1.46 KB,
patch
|
Details | Diff | Splinter Review |
Let's say we just wrote to disk. Everything's fine and _lastSaveTime has been updated with Date.now(). We now immediately close a tab and this leads to saveStateDelayed() being called. Because we just saved, the minimumDelay in saveStateDelayed() will be a few ms less than 15s (the default interval). After 15s, the timer is fired and _saveTimer is set back to null. SessionFile.write() is called and we update _lastSaveTime when the promise is resolved. Now here's the problem: if we close another tab while the SessionFile.write() promise hasn't been resolved yet, minimumDelay will be set to a negative value, because we exceeded the target interval of 15s and the parameter passed (aDelay) will be the timer value, which is 2s by default. Thus we end up writing just 2s after we wrote again. If we now close another tab... we could keep collecting and writing data in very short intervals.
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → smacleod
Status: NEW → ASSIGNED
Assignee | ||
Comment 1•11 years ago
|
||
Attachment #792305 -
Flags: review?(ttaubert)
Reporter | ||
Comment 2•11 years ago
|
||
Comment on attachment 792305 [details] [diff] [review] Patch - Update _lastSaveTime before writing Review of attachment 792305 [details] [diff] [review]: ----------------------------------------------------------------- This is a great and simple solution. We could correct the timeout after we finished writing but I think we shouldn't overcomplicate the code. This will be fine for all the cases where writing takes less time than what the interval is set to.
Attachment #792305 -
Flags: review?(ttaubert) → review+
Assignee | ||
Comment 3•11 years ago
|
||
Attachment #792305 -
Attachment is obsolete: true
Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
Comment 4•11 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/6d655c662b5f
Keywords: checkin-needed
Whiteboard: [fixed-in-fx-team]
Comment 5•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/6d655c662b5f
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 26
You need to log in
before you can comment on or make changes to this bug.
Description
•