Merge pull request #20838 from Luap99/sqlite-timeout

sqlite: set busy timeout to 100s
This commit is contained in:
openshift-merge-bot[bot]
2023-11-29 19:21:12 +00:00
committed by GitHub

View File

@ -40,13 +40,17 @@ const (
sqliteOptionForeignKeys = "&_foreign_keys=1"
// Make sure that transactions happen exclusively.
sqliteOptionTXLock = "&_txlock=exclusive"
// Make sure busy timeout is set to high value to keep retying when the db is locked.
// Timeout is in ms, so set it to 100s to have enough time to retry the operations.
sqliteOptionBusyTimeout = "&_busy_timeout=100000"
// Assembled sqlite options used when opening the database.
sqliteOptions = "db.sql?" +
sqliteOptionLocation +
sqliteOptionSynchronous +
sqliteOptionForeignKeys +
sqliteOptionTXLock
sqliteOptionTXLock +
sqliteOptionBusyTimeout
)
// NewSqliteState creates a new SQLite-backed state database.