Bug 1110691 - Submit which health reporter provider is currently shutting down on AsyncShutdownTimeout. r=yoric,a=lsblakk
authorGeorg Fritzsche <georg.fritzsche@googlemail.com>
Fri, 12 Dec 2014 14:50:07 +0100
changeset 242399 ae5acfeeca692020ad0ff57a10149ec0b9e0d34d
parent 242398 be6ef63abcaadeade0000e252bfb27e61622a610
child 242400 856e6399952ada3605ed7a2f9782e0c23801ea5d
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersyoric, lsblakk
bugs1110691
milestone36.0a2
Bug 1110691 - Submit which health reporter provider is currently shutting down on AsyncShutdownTimeout. r=yoric,a=lsblakk
services/healthreport/healthreporter.jsm
--- a/services/healthreport/healthreporter.jsm
+++ b/services/healthreport/healthreporter.jsm
@@ -332,16 +332,20 @@ function AbstractHealthReporter(branch, 
   this._errors = [];
 
   this._lastDailyDate = null;
 
   // Yes, this will probably run concurrently with remaining constructor work.
   let hasFirstRun = this._prefs.get("service.firstRun", false);
   this._initHistogram = hasFirstRun ? TELEMETRY_INIT : TELEMETRY_INIT_FIRSTRUN;
   this._dbOpenHistogram = hasFirstRun ? TELEMETRY_DB_OPEN : TELEMETRY_DB_OPEN_FIRSTRUN;
+
+  // This is set to the name of the provider that we are currently shutting down, if any.
+  // It is used for AsyncShutdownTimeout diagnostics.
+  this._currentProviderInShutdown = null;
 }
 
 AbstractHealthReporter.prototype = Object.freeze({
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]),
 
   /**
    * Whether the service is fully initialized and running.
    *
@@ -402,17 +406,18 @@ AbstractHealthReporter.prototype = Objec
             shutdownInitiated: this._shutdownInitiated,
             initialized: this._initialized,
             shutdownRequested: this._shutdownRequested,
             initializeHadError: this._initializeHadError,
             providerManagerInProgress: this._providerManagerInProgress,
             storageInProgress: this._storageInProgress,
             hasProviderManager: !!this._providerManager,
             hasStorage: !!this._storage,
-            shutdownComplete: this._shutdownComplete
+            shutdownComplete: this._shutdownComplete,
+            currentProviderInShutdown: this._currentProviderInShutdown,
           }));
 
       try {
         this._storageInProgress = true;
         TelemetryStopwatch.start(this._dbOpenHistogram, this);
         let storage = yield Metrics.Storage(this._dbName);
         TelemetryStopwatch.finish(this._dbOpenHistogram, this);
         yield this._onStorageCreated();
@@ -607,24 +612,27 @@ AbstractHealthReporter.prototype = Objec
     } catch (ex) { }
 
     Task.spawn(function*() {
       try {
         if (this._providerManager) {
           this._log.info("Shutting down provider manager.");
           for (let provider of this._providerManager.providers) {
             try {
+              this._log.info("Shutting down provider: " + provider.name);
+              this._currentProviderInShutdown = provider.name;
               yield provider.shutdown();
             } catch (ex) {
               this._log.warn("Error when shutting down provider: " +
                              CommonUtils.exceptionStr(ex));
             }
           }
           this._log.info("Provider manager shut down.");
           this._providerManager = null;
+          this._currentProviderInShutdown = null;
           this._onProviderManagerShutdown();
         }
         if (this._storage) {
           this._log.info("Shutting down storage.");
           try {
             yield this._storage.close();
             yield this._onStorageClose();
           } catch (error) {