mirror of
https://github.com/containers/podman.git
synced 2026-02-05 06:45:31 +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:
@@ -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 (
|
||||
?, ?, ?,
|
||||
?, ?, ?,
|
||||
?, ?, ?
|
||||
|
||||
Reference in New Issue
Block a user