Bug 1717990 - QM: Ignore NS_ERROR_ABORT in RecordFirstInitializationAttempt; r=dom-storage-reviewers,jstutte
authorJan Varga <jvarga@mozilla.com>
Fri, 25 Jun 2021 06:27:58 +0000
changeset 584358 8cf07efc49e74ea8fd9e00d0f21bc278fa9f0138
parent 584357 789eb9d5f59817f08f7e68df0840657c32083f40
child 584359 68f759c171f29cd56e583d5a08276607aeaadde7
push id38563
push usercbrindusan@mozilla.com
push dateFri, 25 Jun 2021 09:34:36 +0000
treeherdermozilla-central@531323de1a48 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdom-storage-reviewers, jstutte
bugs1717990
milestone91.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1717990 - QM: Ignore NS_ERROR_ABORT in RecordFirstInitializationAttempt; r=dom-storage-reviewers,jstutte Differential Revision: https://phabricator.services.mozilla.com/D118675
dom/quota/FirstInitializationAttemptsImpl.h
--- a/dom/quota/FirstInitializationAttemptsImpl.h
+++ b/dom/quota/FirstInitializationAttemptsImpl.h
@@ -17,16 +17,25 @@
 namespace mozilla::dom::quota {
 
 template <typename Initialization, typename StringGenerator>
 void FirstInitializationAttempts<Initialization, StringGenerator>::
     RecordFirstInitializationAttempt(const Initialization aInitialization,
                                      const nsresult aRv) {
   MOZ_ASSERT(FirstInitializationAttemptPending(aInitialization));
 
+  // NS_ERROR_ABORT signals a non-fatal, recoverable problem during
+  // initialization. We do not want these kind of failures to count against our
+  // overall failure telemetry. Thus we just ignore this kind of failure and
+  // keep mFirstInitializationAttempts unflagged to stay ready to record a real
+  // failure on the next attempt.
+  if (aRv == NS_ERROR_ABORT) {
+    return;
+  }
+
   mFirstInitializationAttempts |= aInitialization;
 
   if constexpr (!std::is_same_v<StringGenerator, Nothing>) {
     Telemetry::Accumulate(Telemetry::QM_FIRST_INITIALIZATION_ATTEMPT,
                           StringGenerator::GetString(aInitialization),
                           static_cast<uint32_t>(NS_SUCCEEDED(aRv)));
   }
 }