Modern IDB: storage/indexeddb/dont-wedge.html sometimes ASSERTs.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Feb 2016 19:27:20 +0000 (19:27 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Feb 2016 19:27:20 +0000 (19:27 +0000)
https://bugs.webkit.org/show_bug.cgi?id=153790

Reviewed by Tim Horton.

Source/WebCore:

No new tests (Failing test now unskipped).

This test uncovered an unhandled race where the main thread tried to perform an OpenDB operation
multiple times while it was already in-progress on the server thread.

There was already a flag meant to cover this race, and it just needed to be applied to one more site.

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
(WebCore::IDBServer::UniqueIDBDatabase::openBackingStore):

LayoutTests:

* platform/mac-wk1/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@196021 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/mac-wk1/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp

index d5c481a..01c2fef 100644 (file)
@@ -1,3 +1,12 @@
+2016-02-02  Brady Eidson  <beidson@apple.com>
+
+        Modern IDB: storage/indexeddb/dont-wedge.html sometimes ASSERTs.
+        https://bugs.webkit.org/show_bug.cgi?id=153790
+
+        Reviewed by Tim Horton.
+
+        * platform/mac-wk1/TestExpectations:
+
 2016-02-02  Zalan Bujtas  <zalan@apple.com>
 
         [Win] gardening after r195740.
index 3be4ea1..fbe7f94 100644 (file)
@@ -270,8 +270,5 @@ storage/indexeddb/modern/transaction-scheduler-6.html [ Skip ]
 storage/indexeddb/prefetch-invalidation.html [ Skip ]
 storage/indexeddb/transaction-coordination-within-database.html [ Skip ]
 
-# SQLite backend tests that crash or ASSERT
-storage/indexeddb/dont-wedge.html [ Skip ]
-
 ### END OF (3) IndexedDB failures with SQLite
 ########################################
index 2a2c4b7..cf33526 100644 (file)
@@ -1,3 +1,21 @@
+2016-02-02  Brady Eidson  <beidson@apple.com>
+
+        Modern IDB: storage/indexeddb/dont-wedge.html sometimes ASSERTs.
+        https://bugs.webkit.org/show_bug.cgi?id=153790
+
+        Reviewed by Tim Horton.
+
+        No new tests (Failing test now unskipped).
+
+        This test uncovered an unhandled race where the main thread tried to perform an OpenDB operation 
+        multiple times while it was already in-progress on the server thread.
+
+        There was already a flag meant to cover this race, and it just needed to be applied to one more site.
+        
+        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
+        (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
+        (WebCore::IDBServer::UniqueIDBDatabase::openBackingStore):
+
 2016-02-02  Daniel Bates  <dabates@apple.com>
 
         CSP: Support checking content security policy without a script execution context
index 9c1943b..73832a5 100644 (file)
@@ -99,14 +99,17 @@ bool UniqueIDBDatabase::isVersionChangeInProgress()
 
 void UniqueIDBDatabase::performCurrentOpenOperation()
 {
-    LOG(IndexedDB, "(main) UniqueIDBDatabase::performCurrentOpenOperation");
+    LOG(IndexedDB, "(main) UniqueIDBDatabase::performCurrentOpenOperation (%p)", this);
 
     ASSERT(m_currentOpenDBRequest);
     ASSERT(m_currentOpenDBRequest->isOpenRequest());
 
     if (!m_databaseInfo) {
-        m_isOpeningBackingStore = true;
-        m_server.postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::openBackingStore, m_identifier));
+        if (!m_isOpeningBackingStore) {
+            m_isOpeningBackingStore = true;
+            m_server.postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::openBackingStore, m_identifier));
+        }
+
         return;
     }
 
@@ -444,7 +447,7 @@ void UniqueIDBDatabase::addOpenDatabaseConnection(Ref<UniqueIDBDatabaseConnectio
 void UniqueIDBDatabase::openBackingStore(const IDBDatabaseIdentifier& identifier)
 {
     ASSERT(!isMainThread());
-    LOG(IndexedDB, "(db) UniqueIDBDatabase::openBackingStore");
+    LOG(IndexedDB, "(db) UniqueIDBDatabase::openBackingStore (%p)", this);
 
     ASSERT(!m_backingStore);
     m_backingStore = m_server.createBackingStore(identifier);