Changeset 236662 in webkit
- Timestamp:
- Oct 1, 2018 9:17:29 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r236661 r236662 1 2018-10-01 Youenn Fablet <youenn@apple.com> 2 3 [macOS Sierra] Layout Test http/wpt/cache-storage/cache-put-keys.https.any.worker.html is a flaky failure 4 https://bugs.webkit.org/show_bug.cgi?id=184204 5 6 Reviewed by Chris Dumez. 7 8 * platform/mac-wk2/TestExpectations: 9 1 10 2018-10-01 Chris Dumez <cdumez@apple.com> 2 11 -
trunk/LayoutTests/platform/mac-wk2/TestExpectations
r236625 r236662 877 877 imported/w3c/web-platform-tests/payment-request/user-accepts-payment-request-algo-manual.https.html [ Skip ] 878 878 879 webkit.org/b/184204 [ Sierra ] http/wpt/cache-storage/cache-put-keys.https.any.worker.html [ Pass Failure ]880 881 879 webkit.org/b/189094 [ HighSierra+ ] accessibility/mac/focus-setting-selection-syncronizing-not-clearing.html [ Skip ] 882 880 -
trunk/Source/WebKit/ChangeLog
r236659 r236662 1 2018-10-01 Youenn Fablet <youenn@apple.com> 2 3 [macOS Sierra] Layout Test http/wpt/cache-storage/cache-put-keys.https.any.worker.html is a flaky failure 4 https://bugs.webkit.org/show_bug.cgi?id=184204 5 6 Reviewed by Chris Dumez. 7 8 NetworkCache::Storage by default limits the length to read to 1500 milliseconds. 9 This is good for the HTTP cache since networking might be faster. 10 It does not work for DOM cache which needs to get these resources even if it takes a long time. 11 12 Since this is disabled by a Mode::Testing option, use it for DOMCache after renaming it to Mode::AvoidRandomness. 13 14 Add a bunch of release logging to help debugging error cases. 15 16 * NetworkProcess/cache/CacheStorageEngineCaches.cpp: 17 (WebKit::CacheStorage::Caches::retrieveOriginFromDirectory): 18 (WebKit::CacheStorage::Caches::initialize): 19 (WebKit::CacheStorage::Caches::writeCachesToDisk): 20 (WebKit::CacheStorage::Caches::readRecord): 21 * NetworkProcess/cache/NetworkCache.cpp: 22 (WebKit::NetworkCache::Cache::open): 23 * NetworkProcess/cache/NetworkCacheStorage.cpp: 24 (WebKit::NetworkCache::Storage::dispatchReadOperation): 25 (WebKit::NetworkCache::Storage::shrinkIfNeeded): 26 * NetworkProcess/cache/NetworkCacheStorage.h: 27 1 28 2018-10-01 Olivier Blin <olivier.blin@softathome.com> 2 29 -
trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp
r235169 r236662 27 27 #include "CacheStorageEngine.h" 28 28 29 #include "Logging.h" 29 30 #include "NetworkCacheCoders.h" 30 31 #include "NetworkCacheIOChannel.h" … … 69 70 ASSERT(RunLoop::isMain()); 70 71 if (error) { 72 RELEASE_LOG_ERROR(CacheStorage, "Caches::retrieveOriginFromDirectory failed reading channel with error %d", error); 71 73 completionHandler(std::nullopt); 72 74 return; … … 139 141 } 140 142 141 auto storage = Storage::open(m_rootPath, Storage::Mode:: Normal);143 auto storage = Storage::open(m_rootPath, Storage::Mode::AvoidRandomness); 142 144 if (!storage) { 145 RELEASE_LOG_ERROR(CacheStorage, "Caches::initialize failed opening storage"); 143 146 callback(Error::WriteDisk); 144 147 return; … … 151 154 storeOrigin([this] (std::optional<Error>&& error) mutable { 152 155 if (error) { 156 RELEASE_LOG_ERROR(CacheStorage, "Caches::initialize failed storing origin with error %d", *error); 157 153 158 auto pendingCallbacks = WTFMove(m_pendingInitializationCallbacks); 154 159 for (auto& callback : pendingCallbacks) … … 163 168 164 169 if (!result.has_value()) { 170 RELEASE_LOG_ERROR(CacheStorage, "Caches::initialize failed reading caches from disk with error %d", result.error()); 171 165 172 auto pendingCallbacks = WTFMove(m_pendingInitializationCallbacks); 166 173 for (auto& callback : pendingCallbacks) … … 368 375 } 369 376 370 static inline Expected<Vector<std::pair<String, String>>, Error> decodeCachesNames(const Data& data, int error) 371 { 372 if (error) 373 return makeUnexpected(Error::ReadDisk); 374 377 static inline Expected<Vector<std::pair<String, String>>, Error> decodeCachesNames(const Data& data) 378 { 375 379 WTF::Persistence::Decoder decoder(data.data(), data.size()); 376 380 uint64_t count; … … 416 420 } 417 421 418 auto result = decodeCachesNames(data, error); 422 if (error) { 423 RELEASE_LOG_ERROR(CacheStorage, "Caches::readCachesFromDisk failed reading caches from disk with error %d", error); 424 callback(makeUnexpected(Error::ReadDisk)); 425 return; 426 } 427 428 auto result = decodeCachesNames(data); 419 429 if (!result.has_value()) { 430 RELEASE_LOG_ERROR(CacheStorage, "Caches::decodeCachesNames failed decoding caches with error %d", result.error()); 420 431 callback(makeUnexpected(result.error())); 421 432 return; … … 447 458 m_engine->writeFile(cachesListFilename(m_rootPath), encodeCacheNames(m_caches), [this, protectedThis = makeRef(*this), callback = WTFMove(callback)](std::optional<Error>&& error) mutable { 448 459 m_isWritingCachesToDisk = false; 460 if (error) 461 RELEASE_LOG_ERROR(CacheStorage, "Caches::writeCachesToDisk failed writing caches to disk with error %d", *error); 462 449 463 callback(WTFMove(error)); 450 464 while (!m_pendingWritingCachesToDiskCallbacks.isEmpty() && !m_isWritingCachesToDisk) … … 510 524 m_storage->retrieve(key, 4, [protectedStorage = makeRef(*m_storage), callback = WTFMove(callback)](std::unique_ptr<Storage::Record> storage, const Storage::Timings&) mutable { 511 525 if (!storage) { 526 RELEASE_LOG_ERROR(CacheStorage, "Caches::readRecord failed reading record from disk"); 512 527 callback(makeUnexpected(Error::ReadDisk)); 513 528 return false; … … 516 531 auto record = Cache::decode(*storage); 517 532 if (!record) { 533 RELEASE_LOG_ERROR(CacheStorage, "Caches::readRecord failed decoding record from disk"); 518 534 callback(makeUnexpected(Error::ReadDisk)); 519 535 return false; -
trunk/Source/WebKit/NetworkProcess/cache/NetworkCache.cpp
r236485 r236662 62 62 RefPtr<Cache> Cache::open(const String& cachePath, OptionSet<Option> options) 63 63 { 64 auto storage = Storage::open(cachePath, options.contains(Option::TestingMode) ? Storage::Mode:: Testing: Storage::Mode::Normal);64 auto storage = Storage::open(cachePath, options.contains(Option::TestingMode) ? Storage::Mode::AvoidRandomness : Storage::Mode::Normal); 65 65 66 66 LOG(NetworkCache, "(NetworkProcess) opened cache storage, success %d", !!storage); -
trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.cpp
r235220 r236662 658 658 659 659 // Avoid randomness during testing. 660 if (m_mode != Mode:: Testing) {660 if (m_mode != Mode::AvoidRandomness) { 661 661 // I/O pressure may make disk operations slow. If they start taking very long time we rather go to network. 662 662 const Seconds readTimeout = 1500_ms; … … 1071 1071 1072 1072 // Avoid randomness caused by cache shrinks. 1073 if (m_mode == Mode:: Testing)1073 if (m_mode == Mode::AvoidRandomness) 1074 1074 return; 1075 1075 -
trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.h
r235169 r236662 48 48 class Storage : public ThreadSafeRefCounted<Storage> { 49 49 public: 50 enum class Mode { Normal, Testing};50 enum class Mode { Normal, AvoidRandomness }; 51 51 static RefPtr<Storage> open(const String& cachePath, Mode); 52 52
Note: See TracChangeset
for help on using the changeset viewer.