Closed Bug 983437 Opened 6 years ago Closed 2 years ago

Delay FHR pruning until the screen is off

Categories

(Android Background Services Graveyard :: Firefox Health Report Service, defect)

All
Android
defect
Not set

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: mcomella, Unassigned)

Details

There is the possibility of FHR pruning causing ANRs in the browser because it may lock the DB and any subsequent event recordings will have to wait on this operation to finish.

We can mitigate the effects of this by delaying FHR pruning until the screen is off, rather than firing it in onPause. Additionally, a slightly faster-to-implement solution is to add a time delay after onPause before starting FHR pruning (but this is more likely to run into coincidental issues).

Some more extreme solutions, if this is found not to work are:
  * Drop recorded events (or store them in SharedPrefs until the DB is free)
  * Have a background thread recording FHR events, which will get blocked when the DB is locked, rather than the whole browser.
I think you need a delay *and* a power check. Otherwise hitting the power button twice in quick succession will be just as bad as hitting Home and then switching back to Fennec.

A rephrasing of the background thread idea: writes should be queued, not block.
Assumes the screen will go off at some point which is not 100% guaranteed (though likely very rare for it not to)
Not actively working on this.
Assignee: michael.l.comella → nobody
We don't do FHR anymore.
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.