Skip to content

Commit 1fb3cdf

Browse files
committed
sqlite: disable WAL mode
As shown in containers#17831, WAL mode plays a role in causing `database is locked` errors. Those are errors, in theory, should not happen as the DB should busy wait. mattn/go-sqlite3/issues/274 has some comments indicating that the busy handler behaves differently in WAL mode which may be an explanation to the error. For now, let's disable WAL mode and only re-enable it when we have clearer understanding of what's going on. The upstream issue along with the SQLite documentation do not give me the clear guidance that I would need. [NO NEW TESTS NEEDED] - flake is only reproducible in CI. Fixes: containers#18356 Signed-off-by: Valentin Rothberg <[email protected]>
1 parent edcb29b commit 1fb3cdf

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

libpod/sqlite_state.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ type SQLiteState struct {
3232
const (
3333
// Deal with timezone automatically.
3434
sqliteOptionLocation = "_loc=auto"
35-
// Set the journal mode (https://www.sqlite.org/pragma.html#pragma_journal_mode).
36-
sqliteOptionJournal = "&_journal=WAL"
37-
// Force WAL mode to fsync after each transaction (https://www.sqlite.org/pragma.html#pragma_synchronous).
35+
// Force an fsync after each transaction (https://www.sqlite.org/pragma.html#pragma_synchronous).
3836
sqliteOptionSynchronous = "&_sync=FULL"
3937
// Allow foreign keys (https://www.sqlite.org/pragma.html#pragma_foreign_keys).
4038
sqliteOptionForeignKeys = "&_foreign_keys=1"
@@ -44,7 +42,6 @@ const (
4442
// Assembled sqlite options used when opening the database.
4543
sqliteOptions = "db.sql?" +
4644
sqliteOptionLocation +
47-
sqliteOptionJournal +
4845
sqliteOptionSynchronous +
4946
sqliteOptionForeignKeys +
5047
sqliteOptionTXLock

0 commit comments

Comments
 (0)