From 4ce05e5ccf791484583e2c1baa5dc5a108836b0e Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Wed, 18 Sep 2024 13:36:45 -0400 Subject: [PATCH] LibWebView: Disable persisted SQL storage when forcing new UI processes We very much assume that the SQL storage backend runs in a singleton process. When this is not the case, and multiple UI processes try to write to the database at the same time, one of them will fail. Since --force-new-process is a testing mode flag, let's just disable the SQL backend when that flag is present. --- Userland/Libraries/LibWebView/Application.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Userland/Libraries/LibWebView/Application.cpp b/Userland/Libraries/LibWebView/Application.cpp index ba7ec3d74dd..4cc013c5b14 100644 --- a/Userland/Libraries/LibWebView/Application.cpp +++ b/Userland/Libraries/LibWebView/Application.cpp @@ -105,6 +105,11 @@ void Application::initialize(Main::Arguments const& arguments, URL::URL new_tab_ create_platform_arguments(args_parser); args_parser.parse(arguments); + // Our persisted SQL storage assumes it runs in a singleton process. If we have multiple UI processes accessing + // the same underlying database, one of them is likely to fail. + if (force_new_process) + disable_sql_database = true; + Optional debug_process_type; Optional profile_process_type;