Bug 1203803: Force cleanup for specific states only; r=khuey a=CLOSED TREE
☠☠ backed out by c3c027f6070d ☠ ☠
authorJan Varga <jan.varga@gmail.com>
Tue, 13 Oct 2015 10:19:43 -0700
changeset 302572 2387ada864282880d3a498d643abe3d8b887ee59
parent 302571 607a236c229994df99766c005f9ec729532d7747
child 302610 83ab506fbe439c6f2e7588c9e0d63e09f1606ba5
child 302652 2287d2415cb7c6d6a4782349fd34f9b85cda3bce
child 302713 af8ff8fe5cdaeabec60c68b6caca7ea6bd2c587a
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey, CLOSED
bugs1203803
milestone44.0a1
first release with
nightly linux32
2387ada86428 / 44.0a1 / 20151014030223 / files
nightly linux64
2387ada86428 / 44.0a1 / 20151014030223 / files
nightly mac
2387ada86428 / 44.0a1 / 20151014030223 / files
nightly win32
2387ada86428 / 44.0a1 / 20151014030223 / files
nightly win64
2387ada86428 / 44.0a1 / 20151014030223 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1203803: Force cleanup for specific states only; r=khuey a=CLOSED TREE
dom/indexedDB/ActorsParent.cpp
--- a/dom/indexedDB/ActorsParent.cpp
+++ b/dom/indexedDB/ActorsParent.cpp
@@ -20125,23 +20125,19 @@ FactoryOp::DirectoryLockFailed()
 
 void
 FactoryOp::ActorDestroy(ActorDestroyReason aWhy)
 {
   AssertIsOnBackgroundThread();
 
   NoteActorDestroyed();
 
-  // There may be an event in the event queue that would do the cleanup later,
-  // but if we are being destroyed abnormally (not by calling
-  // PBackgroundIDBFactoryRequestParent::Send__delete__) we need to do the
-  // cleanup here and just ignore the cleanup event in FactoryOp::Run.
-  // Otherwise some Database objects may be still alive and registered in
-  // gLiveDatabaseHashtable at the time the last factory is destroyed.
-  if (aWhy != Deletion) {
+  if (mState == State::WaitingForTransactionsToComplete ||
+      (mState == State::SendingResults && aWhy != Deletion)) {
+    // We didn't get an opportunity to clean up.  Do that now.
     mState = State::SendingResults;
     IDB_REPORT_INTERNAL_ERR();
     mResultCode = NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
     SendResults();
   }
 }
 
 bool