Bug 1356673 - Fix a crash in RunPingSender at shutdown. r?gfritzsche draft
authorAlessio Placitelli <alessio.placitelli@gmail.com>
Wed, 19 Apr 2017 17:00:21 +0200
changeset 565112 9a7b192080914a33deb3b19c53547b51aa18e974
parent 564098 bb38d935d699e0529f9e0bb35578d381026415c4
child 624923 fcd5aa47380d7c20fb8fa0cb71d22bbcd6fb9961
push id54793
push useralessio.placitelli@gmail.com
push dateWed, 19 Apr 2017 15:01:55 +0000
reviewersgfritzsche
bugs1356673
milestone55.0a1
Bug 1356673 - Fix a crash in RunPingSender at shutdown. r?gfritzsche This patch makes sure to wait on the pingsender process to spawn before shutting down Firefox. MozReview-Commit-ID: CYYcGAy5H2s
toolkit/components/telemetry/TelemetrySend.jsm
--- a/toolkit/components/telemetry/TelemetrySend.jsm
+++ b/toolkit/components/telemetry/TelemetrySend.jsm
@@ -800,20 +800,18 @@ var TelemetrySendImpl = {
 
     // Send the ping using the PingSender, if requested and the user was
     // notified of our policy. We don't support the pingsender on Android,
     // so ignore this option on that platform (see bug 1335917).
     if (options.usePingSender &&
         TelemetryReportingPolicy.canUpload() &&
         AppConstants.platform != "android") {
       const url = this._buildSubmissionURL(ping);
-      // Serialize the ping to the disk and spawn the PingSender.
-      let savePromise = savePing(ping);
-      savePromise.then(() => this._sendWithPingSender(ping.id, url));
-      return savePromise;
+      // Serialize the ping to the disk and then spawn the PingSender.
+      return savePing(ping).then(() => this._sendWithPingSender(ping.id, url));
     }
 
     if (!this.canSendNow) {
       // Sending is disabled or throttled, add this to the persisted pending pings.
       this._log.trace("submitPing - can't send ping now, persisting to disk - " +
                       "canSendNow: " + this.canSendNow);
       return savePing(ping);
     }