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

RESOLVED FIXED in mozilla2.0b9

Status

()

RESOLVED FIXED
9 years ago
8 years ago

People

(Reporter: romaxa, Unassigned)

Tracking

(Blocks: 1 bug)

unspecified
mozilla2.0b9
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [fixed-in-places])

Attachments

(1 attachment)

(Reporter)

Description

9 years ago
Created attachment 402809 [details] [diff] [review]
Current approach which is used in N900 browser, which is switching 2 minutes timer to 1 day timer while in idle state

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.
(Reporter)

Comment 2

9 years ago
(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.

Comment 5

8 years ago
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?)

Updated

8 years ago
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.

Comment 7

8 years ago
(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!

Updated

8 years ago
Duplicate of this bug: 596546
the file has gone on places branch.
Whiteboard: [fixed-in-places]
fixed by dependecies
Status: NEW → RESOLVED
Last Resolved: 8 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.