From fb168fd974b0e4a97653ee0e5fc67da0e61b5649 Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Tue, 28 Mar 2023 11:27:43 +0200 Subject: [PATCH] sqlite: do not `Ping()` after connecting `Ping()` requires the DB lock, so we had to move it into a transaction to fix #17859. Since we try to access the DB directly afterwards, I prefer to let that fail instead of paying the cost of a transaction which would lock the DB for _all_ processes. [NO NEW TESTS NEEDED] as it's a hard to reproduce race. Fixes: #17859 Signed-off-by: Valentin Rothberg --- libpod/sqlite_state.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/libpod/sqlite_state.go b/libpod/sqlite_state.go index 7cf41141a0cc..8289a31d32b4 100644 --- a/libpod/sqlite_state.go +++ b/libpod/sqlite_state.go @@ -80,10 +80,6 @@ func NewSqliteState(runtime *Runtime) (_ State, defErr error) { state.conn = conn - if err := state.conn.Ping(); err != nil { - return nil, fmt.Errorf("cannot connect to database: %w", err) - } - // Migrate schema (if necessary) if err := state.migrateSchemaIfNecessary(); err != nil { return nil, err