trustgraph/trustgraph-flow/trustgraph/storage
cybermaggedon a2dde9cafb
Make all Cassandra and Qdrant I/O async-safe with proper concurrency controls (#916)
Cassandra triples services were using syncronous EntityCentricKnowledgeGraph
methods from async contexts, and connection state was managed with
threading.local which is wrong for asyncio coroutines sharing a single
thread. Qdrant services had no async wrapping at all, blocking the event
loop on every network call. Rows services had unprotected shared state
mutations across concurrent coroutines.

- Add async methods to EntityCentricKnowledgeGraph (async_insert,
  async_get_s/p/o/sp/po/os/spo/all, async_collection_exists,
  async_create_collection, async_delete_collection) using the existing
  cassandra_async.async_execute bridge
- Rewrite triples write + query services: replace threading.local with
  asyncio.Lock + dict cache for per-workspace connections, use async
  ECKG methods for all data operations, keep asyncio.to_thread only for
  one-time blocking ECKG construction
- Wrap all Qdrant calls in asyncio.to_thread across all 6 services
  (doc/graph/row embeddings write + query), add asyncio.Lock + set cache
  for collection existence checks
- Add asyncio.Lock to rows write + query services to protect shared
  state (schemas, sessions, config caches) from concurrent mutation
- Update all affected tests to match new async patterns
2026-05-14 16:00:54 +01:00
..
doc_embeddings Make all Cassandra and Qdrant I/O async-safe with proper concurrency controls (#916) 2026-05-14 16:00:54 +01:00
graph_embeddings Make all Cassandra and Qdrant I/O async-safe with proper concurrency controls (#916) 2026-05-14 16:00:54 +01:00
knowledge Recent fixes -> release/v2.4 (#891) 2026-05-08 19:48:12 +01:00
row_embeddings Make all Cassandra and Qdrant I/O async-safe with proper concurrency controls (#916) 2026-05-14 16:00:54 +01:00
rows Make all Cassandra and Qdrant I/O async-safe with proper concurrency controls (#916) 2026-05-14 16:00:54 +01:00
triples Make all Cassandra and Qdrant I/O async-safe with proper concurrency controls (#916) 2026-05-14 16:00:54 +01:00
__init__.py Feature/pkgsplit (#83) 2024-09-30 19:36:09 +01:00