Bug 1190627 - Part 4 - Add telemetry probe for measuring how often we restore from the backup session copy. r=sebastian
By comparing the rates for FENNEC_SESSIONSTORE_DAMAGED_SESSION_FILE and this new probe, we might be able to infer whether there is a failure mode for the session store where the main session store file is completely lost after an interrupted write and doesn't exist even as an empty file of 0 bytes size.
The first run case will be excluded, because in that case both the main and the backup session file won't exist, so neither telemetry probe will be triggered.
MozReview-Commit-ID: JTR54Vk18jW
--- a/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
@@ -1399,20 +1399,26 @@ public abstract class GeckoApp
// Since we will also hit this situation regularly during first run though,
// we'll only report it in telemetry if we failed to restore despite the
// file existing, which means it's very probably damaged.
if (getProfile().sessionFileExists()) {
Telemetry.addToHistogram("FENNEC_SESSIONSTORE_DAMAGED_SESSION_FILE", 1);
}
try {
restoreMessage = restoreSessionTabs(isExternalURL, true);
+ Telemetry.addToHistogram("FENNEC_SESSIONSTORE_RESTORING_FROM_BACKUP", 1);
} catch (SessionRestoreException ex) {
- // If this fails, too, do a normal startup.
- Log.e(LOGTAG, "An error occurred during restore", ex);
- mShouldRestore = false;
+ if (!mShouldRestore) {
+ // Restoring only "failed" because the backup copy was deliberately empty, too.
+ Telemetry.addToHistogram("FENNEC_SESSIONSTORE_RESTORING_FROM_BACKUP", 1);
+ } else {
+ // Restoring the backup failed, too, so do a normal startup.
+ Log.e(LOGTAG, "An error occurred during restore", ex);
+ mShouldRestore = false;
+ }
}
}
}
}
synchronized (GeckoApp.this) {
mSessionRestoreParsingFinished = true;
GeckoApp.this.notifyAll();
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -9846,10 +9846,18 @@
},
"FENNEC_SESSIONSTORE_DAMAGED_SESSION_FILE": {
"alert_emails": ["jh+bugzilla@buttercookie.de"],
"expires_in_version": "56",
"kind": "flag",
"bug_numbers": [1284017],
"description": "When restoring tabs on startup, reading from sessionstore.js failed, even though the file exists and is not containing an explicitly empty window.",
"cpp_guard": "ANDROID"
+ },
+ "FENNEC_SESSIONSTORE_RESTORING_FROM_BACKUP": {
+ "alert_emails": ["jh+bugzilla@buttercookie.de"],
+ "expires_in_version": "56",
+ "kind": "flag",
+ "bug_numbers": [1190627],
+ "description": "When restoring tabs on startup, reading from sessionstore.js failed, but sessionstore.bak was read successfully.",
+ "cpp_guard": "ANDROID"
}
}