Closed Bug 966707 Opened 10 years ago Closed 3 years ago

Delete old addons.sqlite and extensions.sqlite

Categories

(Firefox for Android Graveyard :: General, defect, P5)

29 Branch
defect

Tracking

(fennec+)

RESOLVED INCOMPLETE
Tracking Status
fennec + ---

People

(Reporter: rnewman, Unassigned, Mentored)

References

Details

(Whiteboard: [lang=java])

These are chewing up over a megabyte of storage on Android. We should get this done for 29.
On Android we can add these two files to our background "pruning" service (bug 942611). We do not want any startup code used to delete files if they exist. We already do enough during startup.

Do the file deletion in the background is our preferred solution on Android.
We should consider using a removed.txt approach in the pruning service…
My plan had been to use a timer in chrome JS to wait a little while after startup, and then async I/O to remove the file; this would serve all platforms. I don't strongly object to using the pruning service on Android, as long as nobody cares about recovering this space on Desktop, but I'd prefer to do it in platform where it will work the same for everyone.
Can we do this by defining some portable format, rather than by writing code that runs everywhere?

Looking at our startup profile times from Eideticker, my reflex is to respond to every sentence that includes the words “chrome JS” with “hell no!”. :P

(Even if — perhaps especially if! — it involves a timer, which seems to just cause unpredictable contention while still incurring module costs. The time is still spent.)

We're dying of papercuts from module inits, startup functions, and otherwise prepping for runtime. Gecko takes three to five seconds to thrash its way to life on a phone.

We need to move to a world in which Gecko does the bare minimum of work at startup, leaving almost every module as a shim until it's needed to actually render a page, and doing nothing that's not strictly necessary for startup. 

(That we load stuff like WebappOSUtils.jsm, PermissionsInstaller.jsm, ContactService.jsm, etc. in the hot startup path is, IMO, a bug.)

I'm happy to duplicate simple features in Java to make that happen, which includes cleanup code.
(In reply to :Irving Reid from comment #3)
> My plan had been to use a timer in chrome JS to wait a little while after
> startup, and then async I/O to remove the file; this would serve all
> platforms. I don't strongly object to using the pruning service on Android,
> as long as nobody cares about recovering this space on Desktop, but I'd
> prefer to do it in platform where it will work the same for everyone.

I think your approach will work OK for any platform but Android, where we actually have background services and different processes where we can run non-critical code.

I say 'OK' because in an ideal world we'd never want to run code in a timer to push it after startup. What if the user is opening a page? Or some other code is delaying using the same tactic? In anycase, this is a perfect opportunity for Android to use a background service and perhaps a #ifndef ANDROID or some other opt-out way for your approach for general Firefox.
Go ahead and do it in the Android pruning service then; when Desktop decides they need to clean up old profile contents they can (hopefully) build something that shares the list of files to clean, so that we don't end up with errors from people only updating one platform's list.
Sounds fair, Irving. Moving this bug.
Component: Add-ons Manager → General
Product: Toolkit → Firefox for Android
Version: 29 Branch → Firefox 29
tracking-fennec: ? → +
Whiteboard: [mentor=rnewman][lang=java]
Mentor: rnewman
Whiteboard: [mentor=rnewman][lang=java] → [lang=java]
Blocks: 1042369
No longer blocks: fatfennec
filter on [mass-p5]
Priority: -- → P5
Cleanup is always worthwhile.
Priority: P5 → --
See Also: → 1238785
Re-triaging per https://bugzilla.mozilla.org/show_bug.cgi?id=1473195

Needinfo :susheel if you think this bug should be re-triaged.
Priority: -- → P5
We have completed our launch of our new Firefox on Android. The development of the new versions use GitHub for issue tracking. If the bug report still reproduces in a current version of [Firefox on Android nightly](https://play.google.com/store/apps/details?id=org.mozilla.fenix) an issue can be reported at the [Fenix GitHub project](https://github.com/mozilla-mobile/fenix/). If you want to discuss your report please use [Mozilla's chat](https://wiki.mozilla.org/Matrix#Connect_to_Matrix) server https://chat.mozilla.org and join the [#fenix](https://chat.mozilla.org/#/room/#fenix:mozilla.org) channel.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INCOMPLETE
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.