Closed Bug 518804 Opened 11 years ago Closed 10 years ago

Places DB flusher, does not handle system-idle state, and drain battery on mobile devices

Categories

(Toolkit :: Places, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla2.0b9

People

(Reporter: romaxa, Unassigned)

References

Details

(Whiteboard: [fixed-in-places])

Attachments

(1 file)

kDefaultSyncInterval = 120; - 2 minutes?

We should suspend Database flusher, when in idle state, also it would be nice to remove repeating timer:

When database changed, or some amount of not synced changes available in Database, then run one-shot timer which will sync database once.
It's a bad idea to change the timer - what happens when something like weave (or any other api consumer) decides to write bookmarks and history during this time?  If we don't flush, we'll get increased memory use, and possible data loss.
(In reply to comment #1)
> It's a bad idea to change the timer - what happens when something like weave
> (or any other api consumer) decides to write bookmarks and history during this

I would suggest to not do anything during that time (suspend weave too), and if something happen, it should create one-shot timer and do flush once when it needed

> time?  If we don't flush, we'll get increased memory use, and possible data
> loss.
expiration must be rewritten before, since the flusher is also doing expiration at this time.

Actually we could probably do something like that, instead of flushing every 2 minutes, flush on history notifications but only if 2 minutes have elapsed from last flush, this should not require any timer.
(In reply to comment #2)
> I would suggest to not do anything during that time (suspend weave too), and if
> something happen, it should create one-shot timer and do flush once when it
> needed
Sure, we can control weave, but we can't control other add-ons.
Would it be possible to flush every 2 minutes, but suspend the timer if nothing relevant has been done since the last time? (In other words, is it straightforward to find out whether something relevant has been done, that requires writing?)
Depends on: 552023
(In reply to comment #5)
> Would it be possible to flush every 2 minutes, but suspend the timer if nothing
> relevant has been done since the last time? (In other words, is it
> straightforward to find out whether something relevant has been done, that
> requires writing?)
We could, but the whole script is going away in bug 552023 which will be landing for Firefox 4.
(In reply to comment #6)
> (In reply to comment #5)
> > Would it be possible to flush every 2 minutes, but suspend the timer if nothing
> > relevant has been done since the last time? (In other words, is it
> > straightforward to find out whether something relevant has been done, that
> > requires writing?)
> We could, but the whole script is going away in bug 552023 which will be
> landing for Firefox 4.

Cool. Thanks for the info!
Duplicate of this bug: 596546
the file has gone on places branch.
Whiteboard: [fixed-in-places]
fixed by dependecies
Status: NEW → RESOLVED
Closed: 10 years ago
OS: Linux → All
Hardware: Other → All
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b9
You need to log in before you can comment on or make changes to this bug.