Bug 1260316 - Make TelemetrySession more resilient if content processes have crashed. r=chutten, a=test-only
authorMike Conley <mconley@mozilla.com>
Tue, 11 Oct 2016 14:09:24 -0400
changeset 350656 e840f66358c4f4145bde6be5c67773d35f76b46d
parent 350655 0f52ce15647e2aed06cc6f451aee237eddca057d
child 350657 0d849c4393fed898813a380bffc81f1921e12778
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschutten, test-only
bugs1260316
milestone50.0
Bug 1260316 - Make TelemetrySession more resilient if content processes have crashed. r=chutten, a=test-only MozReview-Commit-ID: 2CbKYaNcBai
toolkit/components/telemetry/TelemetrySession.jsm
--- a/toolkit/components/telemetry/TelemetrySession.jsm
+++ b/toolkit/components/telemetry/TelemetrySession.jsm
@@ -1140,19 +1140,26 @@ var Impl = {
         this._totalMemoryTimeout = setTimeout(
           () => {
             this._totalMemoryTimeout = undefined;
             this._childrenToHearFrom.clear();
           },
           TOTAL_MEMORY_COLLECTOR_TIMEOUT);
         this._childrenToHearFrom = new Set();
         for (let i = 1; i < ppmm.childCount; i++) {
-          ppmm.getChildAt(i).sendAsyncMessage(MESSAGE_TELEMETRY_GET_CHILD_USS, {id: this._nextTotalMemoryId});
-          this._childrenToHearFrom.add(this._nextTotalMemoryId);
-          this._nextTotalMemoryId++;
+          let child = ppmm.getChildAt(i);
+          try {
+            child.sendAsyncMessage(MESSAGE_TELEMETRY_GET_CHILD_USS, {id: this._nextTotalMemoryId});
+            this._childrenToHearFrom.add(this._nextTotalMemoryId);
+            this._nextTotalMemoryId++;
+          } catch (ex) {
+            // If a content process has just crashed, then attempting to send it
+            // an async message will throw an exception.
+            Cu.reportError(ex);
+          }
         }
       } else {
         boundHandleMemoryReport(
           "MEMORY_TOTAL",
           Ci.nsIMemoryReporter.UNITS_BYTES,
           this._totalMemory);
       }
     }