Bug 1174674 - Always block Telemetry shutdown on pending ping writes. r=gfritzsche
authorAlessio Placitelli <alessio.placitelli@gmail.com>
Fri, 02 Oct 2015 06:35:00 +0200
changeset 266115 b19e47b1b333
parent 266114 5b50080b012b
child 266116 fc2079a6af20
push id29482
push usercbook@mozilla.com
push dateTue, 06 Oct 2015 09:54:56 +0000
treeherdermozilla-central@3edc8d4a1e19 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgfritzsche
bugs1174674
milestone44.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 1174674 - Always block Telemetry shutdown on pending ping writes. r=gfritzsche
toolkit/components/telemetry/TelemetryStorage.jsm
--- a/toolkit/components/telemetry/TelemetryStorage.jsm
+++ b/toolkit/components/telemetry/TelemetryStorage.jsm
@@ -586,16 +586,22 @@ var TelemetryStorageImpl = {
       });
     }
 
     if (this._removePendingPingsTask) {
       yield this._removePendingPingsTask.catch(ex => {
         this._log.error("shutdown - the pending pings removal task failed", ex);
       });
     }
+
+    // Wait on pending pings still being saved. While OS.File should have shutdown
+    // blockers in place, we a) have seen weird errors being reported that might
+    // indicate a bad shutdown path and b) might have completion handlers hanging
+    // off the save operations that don't expect to be late in shutdown.
+    yield this.promisePendingPingSaves();
   }),
 
   /**
    * Save an archived ping to disk.
    *
    * @param {object} ping The ping data to archive.
    * @return {promise} Promise that is resolved when the ping is successfully archived.
    */