commit 25be81a978af6ccf6727046764a43313bbcf1e10
parent b78cf8b7ea5639ef104baaa422f0372ef6f765c9
Author: JohnMcPMS <johnmcp@microsoft.com>
Date: Thu, 3 Jun 2021 18:47:55 -0700
Force connection serialization (#1099)
Diffstat:
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt
@@ -106,6 +106,7 @@ foldc
foldcase
FOLDERID
ftp
+FULLMUTEX
FULLWIDTH
fundraiser
fuzzer
diff --git a/src/AppInstallerRepositoryCore/SQLiteWrapper.cpp b/src/AppInstallerRepositoryCore/SQLiteWrapper.cpp
@@ -125,7 +125,8 @@ namespace AppInstaller::Repository::SQLite
Connection::Connection(const std::string& target, OpenDisposition disposition, OpenFlags flags)
{
AICLI_LOG(SQL, Info, << "Opening SQLite connection: '" << target << "' [" << std::hex << static_cast<int>(disposition) << ", " << std::hex << static_cast<int>(flags) << "]");
- int resultingFlags = static_cast<int>(disposition) | static_cast<int>(flags);
+ // Always force connection serialization until we determine that there are situations where it is not needed
+ int resultingFlags = static_cast<int>(disposition) | static_cast<int>(flags) | SQLITE_OPEN_FULLMUTEX;
THROW_IF_SQLITE_FAILED(sqlite3_open_v2(target.c_str(), &m_dbconn, resultingFlags, nullptr));
}