Bug 1317592 - don't try syncing other engines after one fails with a shutdown error. r=rnewman
authorMark Hammond <mhammond@skippinet.com.au>
Tue, 15 Nov 2016 16:15:03 +1100
changeset 439687 13a9d632e987199ac804ebfcba5678be29179d51
parent 439686 0ecd90195aa2137e9e3fbc363d5e9f6820242937
child 439688 3e47666dbac8edfd480d8b349d6e630d0c709fde
push id36064
push userrthijssen@mozilla.com
push dateWed, 16 Nov 2016 13:38:27 +0000
reviewersrnewman
bugs1317592
milestone53.0a1
Bug 1317592 - don't try syncing other engines after one fails with a shutdown error. r=rnewman MozReview-Commit-ID: LZ72JbOtpm4
services/sync/modules/stages/enginesync.js
--- a/services/sync/modules/stages/enginesync.js
+++ b/services/sync/modules/stages/enginesync.js
@@ -324,16 +324,23 @@ EngineSynchronizer.prototype = {
       if (e.status == 401) {
         // Maybe a 401, cluster update perhaps needed?
         // We rely on ErrorHandler observing the sync failure notification to
         // schedule another sync and clear node assignment values.
         // Here we simply want to muffle the exception and return an
         // appropriate value.
         return false;
       }
+      // Note that policies.js has already logged info about the exception...
+      if (Async.isShutdownException(e)) {
+        // Failure due to a shutdown exception should prevent other engines
+        // trying to start and immediately failing.
+        this._log.info(`${engine.name} was interrupted by shutdown; no other engines will sync`);
+        return false;
+      }
     }
 
     return true;
   },
 
   _updateEnabledFromMeta: function (meta, numClients, engineManager=this.service.engineManager) {
     this._log.info("Updating enabled engines: " +
                     numClients + " clients.");