1
0
mirror of https://github.com/containers/podman.git synced 2026-02-05 15:45:08 +01:00

Merge pull request #28006 from SanjayReddy91/fix-27942

fix: prevent race condition during database initialization by using INSERT OR IGNORE.
This commit is contained in:
Brent Baude
2026-02-03 12:35:15 -06:00
committed by GitHub

View File

@@ -316,8 +316,10 @@ func (s *SQLiteState) ValidateDBConfig(_ *Runtime) (defErr error) {
return err
}
// Ignoring prevents a race condition where multiple Podman processes
// might try to initialize the database at the same time.
const createRow = `
INSERT INTO DBconfig VALUES (
INSERT OR IGNORE INTO DBconfig VALUES (
?, ?, ?,
?, ?, ?,
?, ?, ?