RESOLVED FIXED 190321
Cache API tests are flaky due to file writing failing from time to time
https://bugs.webkit.org/show_bug.cgi?id=190321
Summary Cache API tests are flaky due to file writing failing from time to time
youenn fablet
Reported 2018-10-05 13:18:23 PDT
As can be seen from the flakiness dashboard, http/wpt/cache-storage/cache-put-keys.https.any.worker.html is still failing. From logging gathered on my machine, this is due to errors when writing files through NetworkStorageCache.
Attachments
Patch (12.11 KB, patch)
2018-10-05 13:27 PDT, youenn fablet
no flags
Patch (13.03 KB, patch)
2018-10-05 16:08 PDT, youenn fablet
no flags
Patch (8.37 KB, patch)
2018-10-08 16:27 PDT, youenn fablet
no flags
youenn fablet
Comment 1 2018-10-05 13:27:52 PDT
Alex Christensen
Comment 2 2018-10-05 15:53:17 PDT
Comment on attachment 351695 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=351695&action=review > Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp:386 > +void Engine::writeFile(const String& folderPath, const String& filename, NetworkCache::Data&& data, WebCore::DOMCacheEngine::CompletionCallback&& callback) Shouldn't folderPath be derivable from filename? > Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.cpp:1029 > + RunLoop::main().dispatch([protectedThis = WTFMove(protectedThis), completionHandler = WTFMove(completionHandler)]() mutable { > + completionHandler(); RunLoop::main().dispatch(WTFMove(completionHandler));
youenn fablet
Comment 3 2018-10-05 16:00:33 PDT
(In reply to Alex Christensen from comment #2) > Comment on attachment 351695 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=351695&action=review > > > Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp:386 > > +void Engine::writeFile(const String& folderPath, const String& filename, NetworkCache::Data&& data, WebCore::DOMCacheEngine::CompletionCallback&& callback) > > Shouldn't folderPath be derivable from filename? Sure, I can change that to separate it. > > > Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.cpp:1029 > > + RunLoop::main().dispatch([protectedThis = WTFMove(protectedThis), completionHandler = WTFMove(completionHandler)]() mutable { > > + completionHandler(); > > RunLoop::main().dispatch(WTFMove(completionHandler)); We cannot do that right now. We should probably change to use DestructionThread::Main and stop passing protectedThis back to the main thread. I'll do that in a separate patch though since it is touching more code in NetworkCacheStorage.cpp
youenn fablet
Comment 4 2018-10-05 16:08:31 PDT
Alex Christensen
Comment 5 2018-10-05 21:16:48 PDT
Comment on attachment 351704 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=351704&action=review This is even worse. What I meant is we could only pass one string, like /path/to/file then inside the lambda do a substring operation on it. But I preferred your other approach to this. > Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp:43 > +#define CACHESLIST_FILENAME "cacheslist"_s oh please no.
youenn fablet
Comment 6 2018-10-08 16:27:42 PDT
Chris Dumez
Comment 7 2018-10-12 10:19:27 PDT
Comment on attachment 351831 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=351831&action=review > Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp:508 > + callback(Error::WriteDisk); DiskWrite would look better IMO.
youenn fablet
Comment 8 2018-10-12 10:31:57 PDT
Thanks for the review. > DiskWrite would look better IMO. And ReadDisk -> DiskRead I guess.
Chris Dumez
Comment 9 2018-10-12 10:32:33 PDT
(In reply to youenn fablet from comment #8) > Thanks for the review. > > > DiskWrite would look better IMO. > > And ReadDisk -> DiskRead I guess. Yes.
WebKit Commit Bot
Comment 10 2018-10-12 10:57:27 PDT
Comment on attachment 351831 [details] Patch Clearing flags on attachment: 351831 Committed r237071: <https://trac.webkit.org/changeset/237071>
WebKit Commit Bot
Comment 11 2018-10-12 10:57:29 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 12 2018-10-12 10:58:28 PDT
Note You need to log in before you can comment on or make changes to this bug.