Bug 1317592 - don't try syncing other engines after one fails with a shutdown error. r?rnewman draft
authorMark Hammond <mhammond@skippinet.com.au>
Tue, 15 Nov 2016 16:15:03 +1100
changeset 439457 5e9afd46c42fc11560a49ad619958eae6d556fcf
parent 439387 6916134db0cf59d56916e945e1d91ee2ac1473cd
child 537164 ddd5e08cb9ae3e4acc97e7613b52a983fe20a003
push id36001
push userbmo:markh@mozilla.com
push dateWed, 16 Nov 2016 01:32:34 +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.");