Backed out 2 changesets (bug 1799823, bug 1782990) for causing Geckoview failures. CLOSED TREE

Backed out changeset de83175de08f (bug 1799823)
Backed out changeset a3aa0125da04 (bug 1782990)
This commit is contained in:
Butkovits Atila 2022-11-28 20:47:28 +02:00
Родитель e89fe78030
Коммит 7d91cd9804
3 изменённых файлов: 20 добавлений и 34 удалений

Просмотреть файл

@ -2766,7 +2766,7 @@ BrowserGlue.prototype = {
{
condition: AppConstants.MOZ_UPDATE_AGENT,
task: async () => {
task: () => {
// Never in automation! This is close to
// `UpdateService.disabledForTesting`, but without creating the
// service, which can perform a good deal of I/O in order to log its
@ -2778,14 +2778,14 @@ BrowserGlue.prototype = {
Services.prefs.getBoolPref("app.update.disabledForTesting", false);
if (!disabledForTesting) {
try {
await lazy.BackgroundUpdate.scheduleFirefoxMessagingSystemTargetingSnapshotting();
lazy.BackgroundUpdate.scheduleFirefoxMessagingSystemTargetingSnapshotting();
} catch (e) {
Cu.reportError(
"There was an error scheduling Firefox Messaging System targeting snapshotting: " +
e
);
}
await lazy.BackgroundUpdate.maybeScheduleBackgroundUpdateTask();
lazy.BackgroundUpdate.maybeScheduleBackgroundUpdateTask();
}
},
},

Просмотреть файл

@ -97,9 +97,6 @@ const TELEMETRY_BASENAMES = new Set(["logins", "autofillprofiles"]);
*/
export function JSONFile(config) {
this.path = config.path;
this.sanitizedBasename = PathUtils.filename(this.path)
.replace(/\.json(.lz4)?$/, "")
.replaceAll(/[^a-zA-Z0-9_.]/g, "");
if (typeof config.dataPostProcessor === "function") {
this._dataPostProcessor = config.dataPostProcessor;
@ -125,9 +122,8 @@ export function JSONFile(config) {
this._finalizeAt = config.finalizeAt || IOUtils.profileBeforeChange;
this._finalizeInternalBound = this._finalizeInternal.bind(this);
this._finalizeAt.addBlocker(
`JSON store: writing data for '${this.sanitizedBasename}'`,
this._finalizeInternalBound,
() => ({ sanitizedBasename: this.sanitizedBasename })
"JSON store: writing data",
this._finalizeInternalBound
);
Services.telemetry.setEventRecordingEnabled("jsonfile", true);
@ -219,8 +215,15 @@ JSONFile.prototype = {
// In the event that the file exists, but an exception is thrown because it cannot be read,
// we store it as a .corrupt file for debugging purposes.
let cleansedBasename = PathUtils.filename(this.path)
.replace(/\.json$/, "")
.replaceAll(/[^a-zA-Z0-9_.]/g, "");
let errorNo = ex.winLastError || ex.unixErrno;
this._recordTelemetry("load", errorNo ? errorNo.toString() : "");
this._recordTelemetry(
"load",
cleansedBasename,
errorNo ? errorNo.toString() : ""
);
if (!(DOMException.isInstance(ex) && ex.name == "NotFoundError")) {
Cu.reportError(ex);
@ -232,7 +235,7 @@ JSONFile.prototype = {
0o600
);
await IOUtils.move(this.path, uniquePath);
this._recordTelemetry("load", "invalid_json");
this._recordTelemetry("load", cleansedBasename, "invalid_json");
} catch (e2) {
Cu.reportError(e2);
}
@ -262,7 +265,7 @@ JSONFile.prototype = {
if (this.dataReady) {
return;
}
this._recordTelemetry("load", "used_backup");
this._recordTelemetry("load", cleansedBasename, "used_backup");
} catch (e3) {
if (!(DOMException.isInstance(e3) && e3.name == "NotFoundError")) {
Cu.reportError(e3);
@ -441,18 +444,13 @@ JSONFile.prototype = {
this.data = this._dataPostProcessor ? this._dataPostProcessor(data) : data;
},
_recordTelemetry(method, value) {
if (!TELEMETRY_BASENAMES.has(this.sanitizedBasename)) {
_recordTelemetry(method, cleansedBasename, value) {
if (!TELEMETRY_BASENAMES.has(cleansedBasename)) {
// Avoid recording so we don't log an error in the console.
return;
}
Services.telemetry.recordEvent(
"jsonfile",
method,
this.sanitizedBasename,
value
);
Services.telemetry.recordEvent("jsonfile", method, cleansedBasename, value);
},
/**

Просмотреть файл

@ -640,7 +640,7 @@ var BackgroundUpdate = {
// the regular log apparatus is not available, so use `dump`.
if (lazy.log.shouldLog("debug")) {
dump(
`${SLUG}: shutting down, so not updating Firefox Messaging System targeting information from beforeSave\n`
`${SLUG}: shutting down, so not updating Firefox Messaging System targeting information\n`
);
}
return;
@ -656,7 +656,7 @@ var BackgroundUpdate = {
// We don't `load`, since we don't care about reading existing (now stale)
// data.
snapshot.data = await lazy.ASRouterTargeting.getEnvironmentSnapshot();
snapshot.data = lazy.ASRouterTargeting.getEnvironmentSnapshot();
// Persist.
snapshot.saveSoon();
@ -670,18 +670,6 @@ var BackgroundUpdate = {
// Hold a reference to prevent GC.
this._targetingSnapshottingTimer.initWithCallback(
() => {
if (Services.startup.shuttingDown) {
// Collecting targeting information can be slow and cause shutdown
// crashes, so if we're shutting down, don't try to collect. During
// shutdown, the regular log apparatus is not available, so use `dump`.
if (lazy.log.shouldLog("debug")) {
dump(
`${SLUG}: shutting down, so not updating Firefox Messaging System targeting information from timer\n`
);
}
return;
}
snapshot.saveSoon();
},
// By default, snapshot Firefox Messaging System targeting for use by the