Bug 195707

Summary: Cache API and IDB space usages should be initialized on first quota check
Product: WebKit Reporter: youenn fablet <youennf>
Component: Service WorkersAssignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, alecflett, beidson, cdumez, cgarcia, commit-queue, ews-watchlist, ggaren, jsbell, rniwa, sroberts, tsavell, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 195688, 195804    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch
none
Archive of layout-test-results from ews102 for mac-highsierra
none
Archive of layout-test-results from ews113 for mac-highsierra
none
Archive of layout-test-results from ews206 for win-future
none
Patch
none
Patch
none
Patch
none
Archive of layout-test-results from ews124 for ios-simulator-wk2
none
Patch for landing none

youenn fablet
Reported 2019-03-13 15:25:22 PDT
Cache API and IDB space usages should be initialized on first quota check
Attachments
Patch (26.82 KB, patch)
2019-03-15 13:36 PDT, youenn fablet
no flags
Patch (27.05 KB, patch)
2019-03-20 22:46 PDT, youenn fablet
no flags
Archive of layout-test-results from ews102 for mac-highsierra (2.44 MB, application/zip)
2019-03-20 23:48 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews113 for mac-highsierra (2.25 MB, application/zip)
2019-03-21 00:31 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews206 for win-future (12.95 MB, application/zip)
2019-03-21 00:58 PDT, EWS Watchlist
no flags
Patch (28.36 KB, patch)
2019-03-21 08:16 PDT, youenn fablet
no flags
Patch (29.11 KB, patch)
2019-03-21 09:21 PDT, youenn fablet
no flags
Patch (31.67 KB, patch)
2019-03-21 11:28 PDT, youenn fablet
no flags
Archive of layout-test-results from ews124 for ios-simulator-wk2 (3.27 MB, application/zip)
2019-03-21 13:59 PDT, EWS Watchlist
no flags
Patch for landing (33.39 KB, patch)
2019-03-21 15:10 PDT, youenn fablet
no flags
youenn fablet
Comment 1 2019-03-15 13:36:30 PDT
youenn fablet
Comment 2 2019-03-20 22:46:18 PDT
EWS Watchlist
Comment 3 2019-03-20 23:48:57 PDT
Comment on attachment 365489 [details] Patch Attachment 365489 [details] did not pass mac-ews (mac): Output: https://webkit-queues.webkit.org/results/11593464 New failing tests: http/tests/IndexedDB/storage-limit-2.https.html http/tests/IndexedDB/storage-limit-1.https.html
EWS Watchlist
Comment 4 2019-03-20 23:48:58 PDT
Created attachment 365503 [details] Archive of layout-test-results from ews102 for mac-highsierra The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews102 Port: mac-highsierra Platform: Mac OS X 10.13.6
EWS Watchlist
Comment 5 2019-03-21 00:31:30 PDT
Comment on attachment 365489 [details] Patch Attachment 365489 [details] did not pass mac-debug-ews (mac): Output: https://webkit-queues.webkit.org/results/11593619 New failing tests: http/tests/IndexedDB/storage-limit-2.https.html http/tests/IndexedDB/storage-limit-1.https.html
EWS Watchlist
Comment 6 2019-03-21 00:31:32 PDT
Created attachment 365509 [details] Archive of layout-test-results from ews113 for mac-highsierra The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews113 Port: mac-highsierra Platform: Mac OS X 10.13.6
EWS Watchlist
Comment 7 2019-03-21 00:58:05 PDT
Comment on attachment 365489 [details] Patch Attachment 365489 [details] did not pass win-ews (win): Output: https://webkit-queues.webkit.org/results/11594299 New failing tests: http/tests/IndexedDB/storage-limit-2.https.html http/tests/IndexedDB/storage-limit-1.https.html
EWS Watchlist
Comment 8 2019-03-21 00:58:16 PDT
Created attachment 365513 [details] Archive of layout-test-results from ews206 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: ews206 Port: win-future Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
youenn fablet
Comment 9 2019-03-21 08:16:41 PDT
youenn fablet
Comment 10 2019-03-21 09:21:32 PDT
Chris Dumez
Comment 11 2019-03-21 10:59:45 PDT
Comment on attachment 365556 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=365556&action=review > Source/WebCore/Modules/indexeddb/server/IDBServer.h:128 > + void initializeQuotaUser(const ClientOrigin& origin) { quotaUser(origin); } Please rename quotaUser() to ensureQuotaUser() for clarity, it looks really weird to call a getter and expect a side effect otherwise. > Source/WebCore/Modules/indexeddb/server/IDBServer.h:180 > + WEBCORE_EXPORT QuotaUser& quotaUser(const ClientOrigin&); Please rename. > Source/WebCore/storage/StorageQuotaManager.cpp:90 > + if (m_pendingInitializationUsers.isEmpty()) Do we want to do this only if we actually removed the user from m_pendingInitializationUsers? > Source/WebCore/storage/StorageQuotaManager.cpp:122 > +void StorageQuotaManager::processPendingRequests(Optional<uint64_t> newQuota, ShouldProcessFirst shouldProcessFirst) It is hard for me to understand what ShouldProcessFirst means here? First? Before what? I am calling process function after all. > Source/WebCore/storage/StorageQuotaManager.h:68 > + void processPendingRequests(Optional<uint64_t>, ShouldProcessFirst = ShouldProcessFirst::No); I do not think we should omit the name of the first parameter. > Source/WebKit/NetworkProcess/NetworkProcess.cpp:2397 > +class QuotaUserInitializer : public WebCore::StorageQuotaUser { final
youenn fablet
Comment 12 2019-03-21 11:12:50 PDT
> > Source/WebCore/Modules/indexeddb/server/IDBServer.h:128 > > + void initializeQuotaUser(const ClientOrigin& origin) { quotaUser(origin); } > > Please rename quotaUser() to ensureQuotaUser() for clarity, it looks really > weird to call a getter and expect a side effect otherwise. OK > > Source/WebCore/storage/StorageQuotaManager.cpp:90 > > + if (m_pendingInitializationUsers.isEmpty()) > > Do we want to do this only if we actually removed the user from > m_pendingInitializationUsers? There is no harm in calling it more than necessary. But this is a small optimization. Will do. > > Source/WebCore/storage/StorageQuotaManager.cpp:122 > > +void StorageQuotaManager::processPendingRequests(Optional<uint64_t> newQuota, ShouldProcessFirst shouldProcessFirst) > > It is hard for me to understand what ShouldProcessFirst means here? First? > Before what? I am calling process function after all. Renamed to ShouldDequeueFirstPendingRequest. The point is that on reception of a quota decision from UIProcess, we have all information to take a decision for the first pending request since it was the one triggering the decision from UIProcess. > > Source/WebCore/storage/StorageQuotaManager.h:68 > > + void processPendingRequests(Optional<uint64_t>, ShouldProcessFirst = ShouldProcessFirst::No); > > I do not think we should omit the name of the first parameter. OK > > Source/WebKit/NetworkProcess/NetworkProcess.cpp:2397 > > +class QuotaUserInitializer : public WebCore::StorageQuotaUser { > > final OK
youenn fablet
Comment 13 2019-03-21 11:28:03 PDT
EWS Watchlist
Comment 14 2019-03-21 13:59:12 PDT
Comment on attachment 365577 [details] Patch Attachment 365577 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: https://webkit-queues.webkit.org/results/11603093 New failing tests: http/tests/cache-storage/cache-clearing-origin.https.html
EWS Watchlist
Comment 15 2019-03-21 13:59:14 PDT
Created attachment 365613 [details] Archive of layout-test-results from ews124 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews124 Port: ios-simulator-wk2 Platform: Mac OS X 10.13.6
youenn fablet
Comment 16 2019-03-21 15:10:47 PDT
Created attachment 365624 [details] Patch for landing
youenn fablet
Comment 17 2019-03-21 15:12:56 PDT
(In reply to Build Bot from comment #14) > Comment on attachment 365577 [details] > Patch > > Attachment 365577 [details] did not pass ios-sim-ews (ios-simulator-wk2): > Output: https://webkit-queues.webkit.org/results/11603093 > > New failing tests: > http/tests/cache-storage/cache-clearing-origin.https.html Test is already flaky on MacOS. I updated the expectation for iOS simulator. We might want to change the way we report DOM Cache presence for a given origin. Currently, this is based on presence of a folder, even if empty. This folder will now be created whenever a request for quota is made.
WebKit Commit Bot
Comment 18 2019-03-21 15:52:24 PDT
Comment on attachment 365624 [details] Patch for landing Clearing flags on attachment: 365624 Committed r243339: <https://trac.webkit.org/changeset/243339>
WebKit Commit Bot
Comment 19 2019-03-21 15:52:26 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 20 2019-03-21 16:23:07 PDT
Shawn Roberts
Comment 21 2019-03-25 16:15:06 PDT
It looks like the changes in https://trac.webkit.org/changeset/243345/webkit is causing the following tests to fail around 75% of the time on Mac and iOS Simulator WK2 and Debug http/tests/cache-storage/cache-records-persistency.https.html (was marked flaky previously on Mac) http/tests/cache-storage/cache-clearing-origin.https.html Dashboard : https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html?tests=http%2Ftests%2Fcache-storage%2Fcache-records-persistency.https.html+performance-api%2Fperformance-observer-periodic.html+scrollingcoordinator%2Fios%2Fui-scroll-fixed.html+storage%2Findexeddb%2Fmodern%2Fidbtransaction-objectstore-failures-private.html#showAllRuns=true&tests=http%2Ftests%2Fcache-storage%2Fcache-records-persistency.https.html%20http%2Ftests%2Fcache-storage%2Fcache-clearing-origin.https.html Prior to change the tests were still flaky failures, but after this change they have about a 75% failure rate. Reproduced with : run-webkit-tests http/tests/cache-storage/cache-records-persistency.https.html http/tests/cache-storage/cache-clearing-origin.https.html --iterations 100 --child-process 1 --ios-simulator --exit-after-n-failures=10 --no-retry
Shawn Roberts
Comment 22 2019-03-25 16:28:24 PDT
Pasted wrong revision. The changes in https://trac.webkit.org/changeset/243339 Caused the above.
Truitt Savell
Comment 23 2019-03-26 09:57:59 PDT
It looks like the changes in https://trac.webkit.org/changeset/243339/webkit has caused the test http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html to become significantly flakey. I am able to reproduce the failure using command: run-webkit-tests http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html --iterations 2500 -f The test fails often on 243339 and not on 243338. history: https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=http%2Ftests%2FresourceLoadStatistics%2Fwebsite-data-removal-for-site-navigated-to-with-link-decoration.html Diff: --- /Volumes/Data/slave/highsierra-debug-tests-wk2/build/layout-test-results/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration-expected.txt +++ /Volumes/Data/slave/highsierra-debug-tests-wk2/build/layout-test-results/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration-actual.txt @@ -32,4 +32,4 @@ localhost gotLinkDecorationFromPrevalentResource: No isPrevalentResource: No isVeryPrevalentResource: No - dataRecordsRemoved: 1 + dataRecordsRemoved: 0
youenn fablet
Comment 24 2019-03-26 10:01:26 PDT
I think these issues are explained by https://bugs.webkit.org/show_bug.cgi?id=195707#c17 Either we should change the way we report DOM Cache being there for a given origin or we should delay checking of a user being initialized to the first quota request. The latter is probably better.
Note You need to log in before you can comment on or make changes to this bug.