You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(hive): SQLiteHiveStore connection is shared across threads without a lock #927
SQLiteHiveStore (src/synapsekit/hive/aggregator.py) opens its connection with sqlite3.connect(..., check_same_thread=False) but guards it with no mutex. Every store operation (put/list/revoke) is dispatched from a different worker thread via asyncio.to_thread (the in-process transport). For a pooled/shared memory feature, concurrent submit + suggestions on one connection can raise sqlite3.ProgrammingError/OperationalError or corrupt cursor state.
The comparable marketplace/registry.py guards its connection with a threading.RLock(); this store does not.
Fix: wrap all execute/executescript/commit calls in a threading.Lock/RLock (or open a connection per call). Add a concurrency regression test that fires N to_thread submits at once.
Fixed in #924 (commit 7576299) — all SQLiteHiveStore access is now serialized through a threading.RLock, with a concurrent-to_thread regression test. CI green. Lands on main when #924 merges.
Activity
fix(hive): serialize SQLite access and count distinct contributors
fix(hive): serialize SQLite access and count distinct contributors
AmitoVrito commentedon Aug 12, 2026
Fixed in #924 (commit
7576299) — allSQLiteHiveStoreaccess is now serialized through athreading.RLock, with a concurrent-to_threadregression test. CI green. Lands on main when #924 merges.