sqlite_store.rb line 167-254: @db ||= SQLite3::Database.new(@path).tap { ... } is not thread-safe. Two threads can both see @db as nil and each open a separate SQLite connection. Both will run schema migrations and at_exit hooks independently. The losing thread's DB handle is leaked, and both connections may conflict on schema creation.
REPRODUCTION: Two concurrent Faraday requests hitting the SqliteStore simultaneously.
IMPACT: Database corruption, leaked file descriptors, duplicate schema migrations, duplicate at_exit handlers.
sqlite_store.rb line 167-254: @db ||= SQLite3::Database.new(@path).tap { ... } is not thread-safe. Two threads can both see @db as nil and each open a separate SQLite connection. Both will run schema migrations and at_exit hooks independently. The losing thread's DB handle is leaked, and both connections may conflict on schema creation.
REPRODUCTION: Two concurrent Faraday requests hitting the SqliteStore simultaneously.
IMPACT: Database corruption, leaked file descriptors, duplicate schema migrations, duplicate at_exit handlers.