Title: [291435] trunk
Revision
291435
Author
hey...@apple.com
Date
2022-03-17 13:19:28 -0700 (Thu, 17 Mar 2022)

Log Message

Avoid calling connectionClosedFromServer on a connection twice when a version change is active
https://bugs.webkit.org/show_bug.cgi?id=215271

Reviewed by Sihui Liu.

Source/WebCore:

Since bug 203690, all IDB work is done on a single background thread.
A consequence of this change is that there are states when
UniqueIDBDatabase::m_versionChangeDatabaseConnection is also in
m_openDatabaseConnections. We should avoid calling
connectionClosedFromServer on the same connection twice, since that
can result in a spurious second error event being sent to the
IDBDatabase JS object if connections are closed while a version chnge
is in progress.

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

LayoutTests:

* platform/ios-wk2/TestExpectations:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:
* platform/wincairo/TestExpectations:
Remove test flakiness annotations.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (291434 => 291435)


--- trunk/LayoutTests/ChangeLog	2022-03-17 20:18:06 UTC (rev 291434)
+++ trunk/LayoutTests/ChangeLog	2022-03-17 20:19:28 UTC (rev 291435)
@@ -1,3 +1,16 @@
+2022-03-17  Cameron McCormack  <hey...@apple.com>
+
+        Avoid calling connectionClosedFromServer on a connection twice when a version change is active
+        https://bugs.webkit.org/show_bug.cgi?id=215271
+
+        Reviewed by Sihui Liu.
+
+        * platform/ios-wk2/TestExpectations:
+        * platform/mac/TestExpectations:
+        * platform/win/TestExpectations:
+        * platform/wincairo/TestExpectations:
+        Remove test flakiness annotations.
+
 2022-03-17  Simon Lewis  <simon.le...@apple.com>
 
         Functional tests for read and write methods of JSIPCStreamConnectionBuffer

Modified: trunk/LayoutTests/platform/ios-wk2/TestExpectations (291434 => 291435)


--- trunk/LayoutTests/platform/ios-wk2/TestExpectations	2022-03-17 20:18:06 UTC (rev 291434)
+++ trunk/LayoutTests/platform/ios-wk2/TestExpectations	2022-03-17 20:19:28 UTC (rev 291435)
@@ -1913,8 +1913,6 @@
 
 webkit.org/b/215268 http/wpt/resource-timing/rt-revalidate-requests-3.html [ Pass Failure ]
 
-webkit.org/b/215271 [ Debug ] storage/indexeddb/modern/new-database-after-user-delete.html [ Pass Failure ]
-
 webkit.org/b/215273 svg/animations/smil-multiple-animate-list.svg [ Pass Timeout ]
 
 webkit.org/b/215324 compositing/clipping/border-radius-on-webgl.html [ Pass ImageOnlyFailure Timeout ]

Modified: trunk/LayoutTests/platform/mac/TestExpectations (291434 => 291435)


--- trunk/LayoutTests/platform/mac/TestExpectations	2022-03-17 20:18:06 UTC (rev 291434)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2022-03-17 20:19:28 UTC (rev 291435)
@@ -1704,8 +1704,6 @@
 
 webkit.org/b/215177 [ Release ] editing/selection/navigation-clears-editor-state.html [ Pass Failure ]
 
-webkit.org/b/215271 [ Debug ] storage/indexeddb/modern/new-database-after-user-delete.html [ Pass Failure ]
-
 webkit.org/b/215450 imported/w3c/web-platform-tests/media-source/mediasource-changetype-play-negative.html [ Pass Failure ]
 
 # <rdar://problem/31017631> Stress GC bot failing LayoutTest step with timeout while running WebCryptoAPI/derive_bits_keys tests

Modified: trunk/LayoutTests/platform/win/TestExpectations (291434 => 291435)


--- trunk/LayoutTests/platform/win/TestExpectations	2022-03-17 20:18:06 UTC (rev 291434)
+++ trunk/LayoutTests/platform/win/TestExpectations	2022-03-17 20:19:28 UTC (rev 291435)
@@ -4617,8 +4617,6 @@
 webkit.org/b/204439 fast/repaint/backgroundSizeRepaint.html [ Pass ImageOnlyFailure ]
 webkit.org/b/204440 imported/blink/fast/events/panScroll-crash.html [ Pass Crash ]
 
-webkit.org/b/204489 storage/indexeddb/modern/new-database-after-user-delete.html [ Pass Failure ]
-
 webkit.org/b/204545 fast/xsl/sort-unicode.xml [ Failure ]
 webkit.org/b/204545 svg/W3C-SVG-1.1/paths-data-02-t.svg [ Failure ]
 webkit.org/b/204545 css2.1/20110323/border-conflict-element-001d.htm [ ImageOnlyFailure ]

Modified: trunk/LayoutTests/platform/wincairo/TestExpectations (291434 => 291435)


--- trunk/LayoutTests/platform/wincairo/TestExpectations	2022-03-17 20:18:06 UTC (rev 291434)
+++ trunk/LayoutTests/platform/wincairo/TestExpectations	2022-03-17 20:19:28 UTC (rev 291435)
@@ -1468,8 +1468,6 @@
 
 webkit.org/b/227189 fast/forms/checkbox-and-pseudo.html [ Skip ] # Require expect file for dumped render tree.
 
-webkit.org/b/215271 storage/indexeddb/modern/new-database-after-user-delete.html [ Pass Failure ]
-
 #//////////////////////////////////////////////////////////////////////////////////////////
 # TEMPORARY SKIPS -- these areas still need to be addressed individually
 #//////////////////////////////////////////////////////////////////////////////////////////

Modified: trunk/Source/WebCore/ChangeLog (291434 => 291435)


--- trunk/Source/WebCore/ChangeLog	2022-03-17 20:18:06 UTC (rev 291434)
+++ trunk/Source/WebCore/ChangeLog	2022-03-17 20:19:28 UTC (rev 291435)
@@ -1,3 +1,22 @@
+2022-03-17  Cameron McCormack  <hey...@apple.com>
+
+        Avoid calling connectionClosedFromServer on a connection twice when a version change is active
+        https://bugs.webkit.org/show_bug.cgi?id=215271
+
+        Reviewed by Sihui Liu.
+
+        Since bug 203690, all IDB work is done on a single background thread.
+        A consequence of this change is that there are states when
+        UniqueIDBDatabase::m_versionChangeDatabaseConnection is also in
+        m_openDatabaseConnections. We should avoid calling
+        connectionClosedFromServer on the same connection twice, since that
+        can result in a spurious second error event being sent to the
+        IDBDatabase JS object if connections are closed while a version chnge
+        is in progress.
+
+        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
+        (WebCore::IDBServer::UniqueIDBDatabase::immediateClose):
+
 2022-03-17  Ellie Epskamp-Hunt  <eepskamph...@apple.com>
 
         When a “autofilled and obscured” field becomes empty, turn “autofilled and obscured” off

Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp (291434 => 291435)


--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp	2022-03-17 20:18:06 UTC (rev 291434)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp	2022-03-17 20:19:28 UTC (rev 291435)
@@ -1457,7 +1457,8 @@
         connectionClosedFromServer(*connection);
 
     if (m_versionChangeDatabaseConnection) {
-        connectionClosedFromServer(*m_versionChangeDatabaseConnection);
+        if (!openDatabaseConnections.contains(m_versionChangeDatabaseConnection.get()))
+            connectionClosedFromServer(*m_versionChangeDatabaseConnection);
         m_versionChangeDatabaseConnection = nullptr;
     }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to