зеркало из https://github.com/mozilla/gecko-dev.git
bug 1603833 - re-purpose unused intermediate preloading failure telemetry categories to investigate failures r=kjacobs,leplatrem
Intermediate preloading telemetry is overwhelmingly "failedToObserve", which at the moment is a catch-all indicating that something in updatePreloadedIntermediates failed. We need to figure out why, so this patch re-purposes the categories "emptyAttachment", "failedToFetch", and "unexpectedLength", which are currently not used, to indicate failures in specific sub-operations in that function. Differential Revision: https://phabricator.services.mozilla.com/D57676 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
cdbd115db4
Коммит
16434162c5
|
@ -424,18 +424,57 @@ class IntermediatePreloads {
|
|||
}
|
||||
);
|
||||
});
|
||||
const col = await this.client.openCollection();
|
||||
let col;
|
||||
try {
|
||||
col = await this.client.openCollection();
|
||||
} catch (err) {
|
||||
log.warn(`Unable to open intermediate preloading collection: ${err}`);
|
||||
// Re-purpose the "emptyAttachment" category to indicate opening the collection failed.
|
||||
Services.telemetry
|
||||
.getHistogramById(INTERMEDIATES_ERRORS_TELEMETRY)
|
||||
.add("emptyAttachment");
|
||||
return;
|
||||
}
|
||||
// If we don't have prior data, make it so we re-load everything.
|
||||
if (!hasPriorCertData) {
|
||||
const { data: current } = await col.list({ order: "" }); // no sort needed.
|
||||
let current;
|
||||
try {
|
||||
current = (await col.list({ order: "" })).data; // no sort needed.
|
||||
} catch (err) {
|
||||
log.warn(`Unable to list intermediate preloading collection: ${err}`);
|
||||
// Re-purpose the "failedToFetch" category to indicate listing the collection failed.
|
||||
Services.telemetry
|
||||
.getHistogramById(INTERMEDIATES_ERRORS_TELEMETRY)
|
||||
.add("failedToFetch");
|
||||
return;
|
||||
}
|
||||
const toReset = current.filter(record => record.cert_import_complete);
|
||||
await col.db.execute(transaction => {
|
||||
toReset.forEach(record => {
|
||||
transaction.update({ ...record, cert_import_complete: false });
|
||||
try {
|
||||
await col.db.execute(transaction => {
|
||||
toReset.forEach(record => {
|
||||
transaction.update({ ...record, cert_import_complete: false });
|
||||
});
|
||||
});
|
||||
});
|
||||
} catch (err) {
|
||||
log.warn(`Unable to update intermediate preloading collection: ${err}`);
|
||||
// Re-purpose the "unexpectedLength" category to indicate updating the collection failed.
|
||||
Services.telemetry
|
||||
.getHistogramById(INTERMEDIATES_ERRORS_TELEMETRY)
|
||||
.add("unexpectedLength");
|
||||
return;
|
||||
}
|
||||
}
|
||||
let current;
|
||||
try {
|
||||
current = (await col.list({ order: "" })).data; // no sort needed.
|
||||
} catch (err) {
|
||||
log.warn(`Unable to list intermediate preloading collection: ${err}`);
|
||||
// Re-purpose the "failedToFetch" category to indicate listing the collection failed.
|
||||
Services.telemetry
|
||||
.getHistogramById(INTERMEDIATES_ERRORS_TELEMETRY)
|
||||
.add("failedToFetch");
|
||||
return;
|
||||
}
|
||||
const { data: current } = await col.list({ order: "" }); // no sort needed.
|
||||
const waiting = current.filter(record => !record.cert_import_complete);
|
||||
|
||||
log.debug(`There are ${waiting.length} intermediates awaiting download.`);
|
||||
|
@ -479,13 +518,32 @@ class IntermediatePreloads {
|
|||
.add("failedToUpdateDB");
|
||||
return;
|
||||
}
|
||||
await col.db.execute(transaction => {
|
||||
recordsToUpdate.forEach(record => {
|
||||
transaction.update({ ...record, cert_import_complete: true });
|
||||
try {
|
||||
await col.db.execute(transaction => {
|
||||
recordsToUpdate.forEach(record => {
|
||||
transaction.update({ ...record, cert_import_complete: true });
|
||||
});
|
||||
});
|
||||
});
|
||||
} catch (err) {
|
||||
log.warn(`Unable to update intermediate preloading collection: ${err}`);
|
||||
// Re-purpose the "unexpectedLength" category to indicate updating the collection failed.
|
||||
Services.telemetry
|
||||
.getHistogramById(INTERMEDIATES_ERRORS_TELEMETRY)
|
||||
.add("unexpectedLength");
|
||||
return;
|
||||
}
|
||||
|
||||
const { data: finalCurrent } = await col.list();
|
||||
let finalCurrent;
|
||||
try {
|
||||
finalCurrent = (await col.list({ order: "" })).data; // no sort needed.
|
||||
} catch (err) {
|
||||
log.warn(`Unable to list intermediate preloading collection: ${err}`);
|
||||
// Re-purpose the "failedToFetch" category to indicate listing the collection failed.
|
||||
Services.telemetry
|
||||
.getHistogramById(INTERMEDIATES_ERRORS_TELEMETRY)
|
||||
.add("failedToFetch");
|
||||
return;
|
||||
}
|
||||
const finalWaiting = finalCurrent.filter(
|
||||
record => !record.cert_import_complete
|
||||
);
|
||||
|
|
Загрузка…
Ссылка в новой задаче