...
An example trace when network process is killed for holding database lock: Thread 3 Dispatch queue: WebResourceLoadStatisticsStore Process Data Queue ... 13 libsqlite3.dylib 0x1f666f8e0 sqlite3LockAndPrepare + 244 (/Library/Caches/com.apple.xbs/Sources/SQLite/derived_source/sqlite3.c:139474) 14 WebCore 0x1e8b30858 WebCore::SQLiteDatabase::prepareStatement(WTF::ASCIILiteral) + 120 (/Library/Caches/com.apple.xbs/Sources/WebCore/Source/WebCore/./platform/sql/SQLiteDatabase.cpp:696) 15 WebCore 0x1e8b30298 WebCore::SQLiteDatabase::open(WTF::String const&, WebCore::SQLiteDatabase::OpenMode) + 1776 (/Library/Caches/com.apple.xbs/Sources/WebCore/Source/WebCore/./platform/sql/SQLiteDatabase.cpp:228) 16 WebKit 0x1e64953bc WebKit::DatabaseUtilities::openDatabaseAndCreateSchemaIfNecessary() + 148 (/Library/Caches/com.apple.xbs/Sources/WebKit/Source/WebKit/NetworkProcess/DatabaseUtilities.cpp:92) 17 WebKit 0x1e65296bc WTF::Detail::CallableWrapper<WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore(WebKit::NetworkSession&, WTF::String const&, WebKit::ShouldIncludeLocalhost, WebCore::ResourceLoadStatistics::IsEphemeral)::$_33, void>::call() + 788 (/Library/Caches/com.apple.xbs/Sources/WebKit/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:341) ...
<rdar://problem/87741289>
Created attachment 449446 [details] Patch
Comment on attachment 449446 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=449446&action=review > Source/WebCore/ChangeLog:3 > + Assertion is not acquired in network process when setting database journal mode What is the effect of not acquiring this assertion? Is there a test failing because of this mistake>
(In reply to Darin Adler from comment #4) > Comment on attachment 449446 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=449446&action=review > > > Source/WebCore/ChangeLog:3 > > + Assertion is not acquired in network process when setting database journal mode > > What is the effect of not acquiring this assertion? Is there a test failing > because of this mistake> Assertion is needed for keeping process active. If assertion is not held, process can be suspended. When a process is suspended and it's holding file lock, it will get killed by running boardd (to ensure file lock is released). So we need to hold assertion when doing database activities that requires file lock. There is no test (since it involves daemons), but we see network process gets killed with trace I pasted above. More traces in rdar://82412733.
Created attachment 449464 [details] Patch
Comment on attachment 449464 [details] Patch r=me
Committed r288223 (246183@main): <https://commits.webkit.org/246183@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 449464 [details].