Title: [179254] trunk/Source/WebKit2
Revision
179254
Author
[email protected]
Date
2015-01-28 09:08:16 -0800 (Wed, 28 Jan 2015)

Log Message

http/tests/xmlhttprequest/workers/methods.html sometimes times out with disk cache enabled
https://bugs.webkit.org/show_bug.cgi?id=140976

Reviewed by Chris Dumez.

Running

    run-webkit-tests --release -2 http/tests/xmlhttprequest/workers/methods.html --iterations=100

would usually time out an iteration.

* NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
(WebKit::NetworkCacheStorage::dispatchRetrieveOperation):

Using dispatch_io_read with an empty file calls the handler block immediately with done boolean set
without it being an error. We failed to call the completion handler and any synchronous xhr would hang.
We may see an empty cache file if we are just in process of writing it.

Fix by handling this case specifically.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (179253 => 179254)


--- trunk/Source/WebKit2/ChangeLog	2015-01-28 17:02:32 UTC (rev 179253)
+++ trunk/Source/WebKit2/ChangeLog	2015-01-28 17:08:16 UTC (rev 179254)
@@ -1,3 +1,25 @@
+2015-01-27  Antti Koivisto  <[email protected]>
+
+        http/tests/xmlhttprequest/workers/methods.html sometimes times out with disk cache enabled
+        https://bugs.webkit.org/show_bug.cgi?id=140976
+
+        Reviewed by Chris Dumez.
+
+        Running
+
+            run-webkit-tests --release -2 http/tests/xmlhttprequest/workers/methods.html --iterations=100
+
+        would usually time out an iteration.
+
+        * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
+        (WebKit::NetworkCacheStorage::dispatchRetrieveOperation):
+
+        Using dispatch_io_read with an empty file calls the handler block immediately with done boolean set
+        without it being an error. We failed to call the completion handler and any synchronous xhr would hang.
+        We may see an empty cache file if we are just in process of writing it.
+
+        Fix by handling this case specifically.
+
 2015-01-28  Carlos Garcia Campos  <[email protected]>
 
         Unreviewed. Add missing file to WebInspector compilation for GTK+.

Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorageCocoa.mm (179253 => 179254)


--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorageCocoa.mm	2015-01-28 17:02:32 UTC (rev 179253)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorageCocoa.mm	2015-01-28 17:08:16 UTC (rev 179254)
@@ -373,8 +373,12 @@
                 removeEntry(retrieve.key);
                 return;
             }
-            if (done)
+            if (done) {
+                // File exists but is empty. Invoke the completion handler as it hasn't been done yet.
+                if (fileData == dispatch_data_empty)
+                    retrieve.completionHandler(nullptr);
                 return;
+            }
             auto entry = decodeEntry(fileData, fd, retrieve.key);
             bool success = retrieve.completionHandler(WTF::move(entry));
             if (!success)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to