Bug 1513496 - Stop logging failure warnings if the scalar is expired. r=chutten
authorKaio Augusto de Camargo <kaioaugusto.8@gmail.com>
Mon, 14 Jan 2019 18:33:13 +0000
changeset 513752 d352b4fe9d6808091c236afc68e6c6d242f9f17c
parent 513751 93c0ed8f369080be59f2dd3a705e9fd8290f7813
child 513753 da7597af4dd14b004ca141dc0a42f6683b8f5943
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschutten
bugs1513496
milestone66.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 1513496 - Stop logging failure warnings if the scalar is expired. r=chutten Currently, when operating with scalars, if a call to internal_GetScalarByEnum (or its keyed variant) return an error, then a warning will be logged. If one of the requested scalars is expired, this could lead to an unwated flood of logs. With this change, the return of the function is checked, and if it is NS_ERROR_NOT_AVAILABLE (i.e. expired scalar), then no warning is issued. Differential Revision: https://phabricator.services.mozilla.com/D16392
toolkit/components/telemetry/core/TelemetryScalar.cpp
--- a/toolkit/components/telemetry/core/TelemetryScalar.cpp
+++ b/toolkit/components/telemetry/core/TelemetryScalar.cpp
@@ -2153,17 +2153,20 @@ void internal_ApplyScalarActions(
     MOZ_ASSERT(processType != ProcessID::Count);
 
     // Refresh the data in the parent process with the data coming from the
     // child processes.
     ScalarBase* scalar = nullptr;
     nsresult rv =
         internal_GetScalarByEnum(lock, uniqueId, processType, &scalar);
     if (NS_FAILED(rv)) {
-      NS_WARNING("NS_FAILED internal_GetScalarByEnum for CHILD");
+      // Bug 1513496 - We no longer log a warning if the scalar is expired.
+      if (rv != NS_ERROR_NOT_AVAILABLE) {
+        NS_WARNING("NS_FAILED internal_GetScalarByEnum for CHILD");
+      }
       continue;
     }
 
     if (upd.mData.isNothing()) {
       MOZ_ASSERT(false, "There is no data in the ScalarActionType.");
       continue;
     }
 
@@ -2266,17 +2269,20 @@ void internal_ApplyKeyedScalarActions(
     MOZ_ASSERT(processType != ProcessID::Count);
 
     // Refresh the data in the parent process with the data coming from the
     // child processes.
     KeyedScalar* scalar = nullptr;
     nsresult rv =
         internal_GetKeyedScalarByEnum(lock, uniqueId, processType, &scalar);
     if (NS_FAILED(rv)) {
-      NS_WARNING("NS_FAILED internal_GetScalarByEnum for CHILD");
+      // Bug 1513496 - We no longer log a warning if the scalar is expired.
+      if (rv != NS_ERROR_NOT_AVAILABLE) {
+        NS_WARNING("NS_FAILED internal_GetScalarByEnum for CHILD");
+      }
       continue;
     }
 
     if (upd.mData.isNothing()) {
       MOZ_ASSERT(false, "There is no data in the KeyedScalarAction.");
       continue;
     }