Backed out changeset 5ef08ec39cd7 (bug 1305444) for failures in browser_upgrade_backup.js
authorPhil Ringnalda <philringnalda@gmail.com>
Tue, 27 Sep 2016 19:59:59 -0700
changeset 315396 8c84b761884028e774165afce0b6eea847b09835
parent 315395 fb4fd0ff521501151f43eb1dc07294bbc88f8130
child 315414 1e7f590415adb88c3699ff073111027e1edf1592
child 315519 8eef5d2cc850385855bdfd97016bab78c4484085
push id30748
push usercbook@mozilla.com
push dateWed, 28 Sep 2016 13:53:19 +0000
treeherdermozilla-central@8c84b7618840 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1305444
milestone52.0a1
backs out5ef08ec39cd74f6572442b32dc8677a12040a70a
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
Backed out changeset 5ef08ec39cd7 (bug 1305444) for failures in browser_upgrade_backup.js CLOSED TREE
browser/components/sessionstore/SessionWorker.js
--- a/browser/components/sessionstore/SessionWorker.js
+++ b/browser/components/sessionstore/SessionWorker.js
@@ -145,33 +145,34 @@ var Agent = {
           tab.entries = tab.entries.slice(lower, upper);
           tab.index -= lower;
         }
       }
     }
 
     let stateString = JSON.stringify(state);
     let data = Encoder.encode(stateString);
+    let startWriteMs, stopWriteMs;
 
     try {
 
       if (this.state == STATE_CLEAN || this.state == STATE_EMPTY) {
         // The backups directory may not exist yet. In all other cases,
         // we have either already read from or already written to this
         // directory, so we are satisfied that it exists.
         File.makeDir(this.Paths.backups);
       }
 
       if (this.state == STATE_CLEAN) {
         // Move $Path.clean out of the way, to avoid any ambiguity as
         // to which file is more recent.
         File.move(this.Paths.clean, this.Paths.cleanBackup);
       }
 
-      let startWriteMs = Date.now();
+      startWriteMs = Date.now();
 
       if (options.isFinalWrite) {
         // We are shutting down. At this stage, we know that
         // $Paths.clean is either absent or corrupted. If it was
         // originally present and valid, it has been moved to
         // $Paths.cleanBackup a long time ago. We can therefore write
         // with the guarantees that we erase no important data.
         File.writeAtomic(this.Paths.clean, data, {
@@ -192,18 +193,17 @@ var Agent = {
         // In other cases, either $Path.recovery is not necessary, or
         // it doesn't exist or it has been corrupted. Regardless,
         // don't backup $Path.recovery.
         File.writeAtomic(this.Paths.recovery, data, {
           tmpPath: this.Paths.recovery + ".tmp"
         });
       }
 
-      telemetry[FX_SESSION_RESTORE_WRITE_FILE_MS] = Date.now() - startWriteMs;
-      telemetry[FX_SESSION_RESTORE_FILE_SIZE_BYTES] = data.byteLength;
+      stopWriteMs = Date.now();
 
     } catch (ex) {
       // Don't throw immediately
       exn = exn || ex;
     }
 
     // If necessary, perform an upgrade backup
     let upgradeBackupComplete = false;
@@ -271,17 +271,20 @@ var Agent = {
     if (exn) {
       throw exn;
     }
 
     return {
       result: {
         upgradeBackup: upgradeBackupComplete
       },
-      telemetry: telemetry,
+      telemetry: {
+        FX_SESSION_RESTORE_WRITE_FILE_MS: stopWriteMs - startWriteMs,
+        FX_SESSION_RESTORE_FILE_SIZE_BYTES: data.byteLength,
+      }
     };
   },
 
   /**
    * Wipes all files holding session data from disk.
    */
   wipe: function () {