1
0
Fork 0

Closes #6937: Disable runStorageMaintenance during startup

This call will acquire a "write" lock at the storage layer (sqlite's reserved+),
which may interfere with migrations that run during startup as well (they need to
write to storage, and so also need to acquire a lock). If these operations clash,
we get a SQLITE_BUSY crash. For now, just disable the maintenance operation.
master
Grisha Kruglov 2019-12-16 15:13:45 -08:00 committed by Grisha Kruglov
parent ea486d7c66
commit 52334f9121
1 changed files with 9 additions and 3 deletions

View File

@ -131,11 +131,17 @@ open class FenixApplication : Application() {
components.core.sessionManager.register(NotificationSessionObserver(this))
if ((System.currentTimeMillis() - settings().lastPlacesStorageMaintenance) > ONE_DAY_MILLIS) {
runStorageMaintenance()
}
// Storage maintenance disabled, for now, as it was interfering with background migrations.
// See https://github.com/mozilla-mobile/fenix/issues/7227 for context.
// if ((System.currentTimeMillis() - settings().lastPlacesStorageMaintenance) > ONE_DAY_MILLIS) {
// runStorageMaintenance()
// }
}
// See https://github.com/mozilla-mobile/fenix/issues/7227 for context.
// To re-enable this, we need to do so in a way that won't interfere with any startup operations
// which acquire reserved+ sqlite lock. Currently, Fennec migrations need to write to storage
// on startup, and since they run in a background service we can't simply order these operations.
private fun runStorageMaintenance() {
GlobalScope.launch(Dispatchers.IO) {
// Bookmarks and history storage sit on top of the same db file so we only need to