Bug 1367659 Remove KeepAliveHandler::RemovePromise() assertion that can be wrong during worker thread shutdown. r=asuth
authorBen Kelly <ben@wanderview.com>
Thu, 01 Jun 2017 06:20:12 -0700
changeset 361855 e398680c483332f16c829adbddb29528c566c180
parent 361854 87c1327b918d380df584858e28c23d7340c65994
child 361856 58119f6aff8f379773adc0f14c68f7ae3d632c08
push id31946
push userryanvm@gmail.com
push dateThu, 01 Jun 2017 20:43:38 +0000
treeherdermozilla-central@b138d2f271fd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersasuth
bugs1367659
milestone55.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 1367659 Remove KeepAliveHandler::RemovePromise() assertion that can be wrong during worker thread shutdown. r=asuth
dom/workers/ServiceWorkerPrivate.cpp
--- a/dom/workers/ServiceWorkerPrivate.cpp
+++ b/dom/workers/ServiceWorkerPrivate.cpp
@@ -352,18 +352,22 @@ private:
   }
 
   void
   RemovePromise(ExtendableEventResult aResult)
   {
     MOZ_ASSERT(mWorkerPrivate);
     mWorkerPrivate->AssertIsOnWorkerThread();
     MOZ_DIAGNOSTIC_ASSERT(mPendingPromisesCount > 0);
-    MOZ_ASSERT(mSelfRef);
-    MOZ_ASSERT(mKeepAliveToken);
+
+    // Note: mSelfRef and mKeepAliveToken can be nullptr here
+    //       if MaybeCleanup() was called just before a promise
+    //       settled.  This can happen, for example, if the
+    //       worker thread is being terminated for running too
+    //       long, browser shutdown, etc.
 
     mRejected |= (aResult == Rejected);
 
     --mPendingPromisesCount;
     if (mPendingPromisesCount) {
       return;
     }