Merge pull request #1162 from imtylervo/fix/palace-write-lock-queue-pattern

fix: serialize ChromaCollection writes through palace lock
This commit is contained in:
Igor Lins e Silva
2026-05-06 01:48:51 -03:00
committed by GitHub
5 changed files with 491 additions and 17 deletions
+2 -2
View File
@@ -374,7 +374,7 @@ def _get_collection(create=False):
**ef_kwargs,
)
_pin_hnsw_threads(raw)
_collection_cache = ChromaCollection(raw)
_collection_cache = ChromaCollection(raw, palace_path=_config.palace_path)
_metadata_cache = None
_metadata_cache_time = 0
elif _collection_cache is None:
@@ -382,7 +382,7 @@ def _get_collection(create=False):
ef_kwargs = {"embedding_function": ef} if ef is not None else {}
raw = client.get_collection(_config.collection_name, **ef_kwargs)
_pin_hnsw_threads(raw)
_collection_cache = ChromaCollection(raw)
_collection_cache = ChromaCollection(raw, palace_path=_config.palace_path)
_metadata_cache = None
_metadata_cache_time = 0
return _collection_cache