Commit 18f2aa68 authored by Kaio Augusto de Camargo's avatar Kaio Augusto de Camargo
Browse files

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

--HG--
extra : moz-landing-system : lando
parent 3bd2052e
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -2158,7 +2158,10 @@ void internal_ApplyScalarActions(
    nsresult rv =
        internal_GetScalarByEnum(lock, uniqueId, processType, &scalar);
    if (NS_FAILED(rv)) {
      // 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;
    }

@@ -2271,7 +2274,10 @@ void internal_ApplyKeyedScalarActions(
    nsresult rv =
        internal_GetKeyedScalarByEnum(lock, uniqueId, processType, &scalar);
    if (NS_FAILED(rv)) {
      // 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;
    }