LightRAG/lightrag/kg
chengjie 9e3c64df03 fix: critical bugs in workspace lock multiprocess synchronization
Bug 1a - RuntimeError when _registry_guard is None:
- Added explicit check for _registry_guard initialization
- Now raises clear RuntimeError instead of cryptic TypeError
- Helps users understand they need to call initialize_share_data() first

Bug 1b - Workspace async_locks not visible across processes:
- Created new _workspace_async_locks dict for per-process storage
- Fixed issue where async_locks modifications in one process were invisible to others
- This is correct design since asyncio.Lock objects cannot be pickled/shared

Why per-process async_locks:
- asyncio.Lock objects cannot be shared across processes
- Each process needs its own asyncio.Lock instances for coroutine sync
- Cross-process sync is handled by Manager.RLock() in _sync_locks
- Within-process async sync is handled by per-process asyncio.Lock

Testing:
- All 17 existing workspace lock tests pass
- Added 3 new tests specifically for bug verification
- Total 20 tests passing

Impact:
- Fixes potential race conditions in multiprocess scenarios
- Ensures proper synchronization both across and within processes
- Maintains backward compatibility
2025-11-11 00:15:06 +08:00
..
deprecated Preserve ordering in get_by_ids methods across all storage implementations 2025-10-11 12:37:59 +08:00
__init__.py Improve storage config validation and add config.ini fallback support 2025-11-08 22:48:49 +08:00
faiss_impl.py Fix get_by_ids to return None for missing records consistently 2025-10-11 13:34:26 +08:00
json_doc_status_impl.py Add entity/relation chunk tracking with configurable source ID limits 2025-10-20 15:24:15 +08:00
json_kv_impl.py Add entity/relation chunk tracking with configurable source ID limits 2025-10-20 15:24:15 +08:00
memgraph_impl.py Remove unused chunk-based node/edge retrieval methods 2025-11-06 18:17:10 +08:00
milvus_impl.py Remove enable_logging parameter from get_data_init_lock call in MilvusVectorDBStorage 2025-10-29 09:49:59 +08:00
mongo_impl.py Remove unused chunk-based node/edge retrieval methods 2025-11-06 18:17:10 +08:00
nano_vector_db_impl.py Fix vector deletion logging to show actual deleted count 2025-10-27 14:22:16 +08:00
neo4j_impl.py Remove unused chunk-based node/edge retrieval methods 2025-11-06 18:17:10 +08:00
networkx_impl.py Remove unused chunk-based node/edge retrieval methods 2025-11-06 18:17:10 +08:00
postgres_impl.py Fix linting 2025-11-06 20:48:51 +08:00
qdrant_impl.py Add Qdrant legacy collection migration with workspace support 2025-10-30 19:16:33 +08:00
redis_impl.py Fix Redis data migration error 2025-10-21 16:27:04 +08:00
shared_storage.py fix: critical bugs in workspace lock multiprocess synchronization 2025-11-11 00:15:06 +08:00