Bug 1338800 - await completeDeferred for all resources r=mak
authorDoug Thayer <dothayer@mozilla.com>
Fri, 17 Nov 2017 11:45:44 -0800
changeset 392806 90b13fe1c2b6900192e40632098cb48719bb8dae
parent 392805 a41c4aadd9145da461b0c60637c2dd20777118d9
child 392807 a3e00fccf66070dd20cb51cc758e0e3bce919e5e
push id97527
push usertoros@mozilla.com
push dateTue, 21 Nov 2017 10:20:05 +0000
treeherdermozilla-inbound@60d0f3ee0c43 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1338800, 1418455
milestone59.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 1338800 - await completeDeferred for all resources r=mak To reduce any contention from migrating multiple resources at the same time, it seems prudent to wait for each to finish before migrating the next. res.migrate is only sometimes properly async, so the simplest thing to do today is to just always await completeDeferred.promise. Additionally I am filing Bug 1418455 to track simplifying this to simply await res.migrate. MozReview-Commit-ID: LdgNsxfuzu4
browser/components/migration/MigrationUtils.jsm
--- a/browser/components/migration/MigrationUtils.jsm
+++ b/browser/components/migration/MigrationUtils.jsm
@@ -359,23 +359,17 @@ this.MigratorPrototype = {
           // (itemMayBeDone) might haven't been called.
           try {
             res.migrate(resourceDone);
           } catch (ex) {
             Cu.reportError(ex);
             resourceDone(false);
           }
 
-          // Certain resources must be ran sequentially or they could fail,
-          // for example bookmarks and history (See bug 1272652).
-          if (migrationType == MigrationUtils.resourceTypes.BOOKMARKS ||
-              migrationType == MigrationUtils.resourceTypes.HISTORY) {
-            await completeDeferred.promise;
-          }
-
+          await completeDeferred.promise;
           await unblockMainThread();
         }
       }
     };
 
     if (MigrationUtils.isStartupMigration && !this.startupOnlyMigrator) {
       MigrationUtils.profileStartup.doStartup();
       // First import the default bookmarks.