QdrantDocumentStore(location=":memory:"): sync and async clients don't share data, so mixed use silently returns empty results
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 56/100
Direzione di ricerca
The issue identifies _initialize_client and _initialize_async_client as the entry points and says the behavior reproduces on main at commit 8249f30. Read those initializers and the Qdrant document store tests; first check how each client is created for location=":memory:". Done means mixed sync and async use either shares documents or raises a clear error, with tests covering both client creation orders.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
With location=":memory:", QdrantDocumentStore creates a separate QdrantClient (sync) and AsyncQdrantClient (async). Each in-memory client gets its own isolated database, so documents written through the async API are invisible to the sync API and vice versa. count_documents / filter_documents just return 0 / [], with no error or warning.
This is easy to hit in tests and in pipelines that mix run and run_async. Using a shared local path instead isn't a workaround either: the second local client fails on Qdrant's exclusive storage lock.
To Reproduce
import asyncio
from haystack import Document
from haystack.document_stores.types import DuplicatePolicy
from haystack_integrations.document_stores.qdrant import QdrantDocumentStore
async def main():
store = QdrantDocumentStore(location=":memory:", index="iso", embedding_dim=2, progress_bar=False)
await store.write_documents_async(
[Document(id="a", content="hello", embedding=[1.0, 0.0])],
policy=DuplicatePolicy.FAIL,
)
print("async count:", await store.count_documents_async()) # 1
print("sync count after async write:", store.count_documents()) # 0
store2 = QdrantDocumentStore(location=":memory:", index="iso2", embedding_dim=2, progress_bar=False)
store2.write_documents(
[Document(id="b", content="sync", embedding=[0.0, 1.0])],
policy=DuplicatePolicy.FAIL,
)
print("sync count:", store2.count_documents()) # 1
print("async count after sync write:", await store2.count_documents_async()) # 0
asyncio.run(main())
Output:
async count: 1
sync count after async write: 0
sync count: 1
async count after sync write: 0
Expected behavior
Either the sync and async methods see the same in-memory documents, or the store raises a clear error when the second client would be created for :memory: (and the docs note that mixing sync and async needs a Qdrant server via url/host). Silently returning empty results is the harmful case.
Root cause
_initialize_client and _initialize_async_client each build a new client from the same location, and for :memory: qdrant-client gives each client its own storage.
Possible fix
I have a local patch that raises QdrantStoreError when the second style of client would be opened on a :memory: store, with tests. Sync-only and async-only in-memory usage is unchanged. Happy to open a PR if this approach works for you, or adjust if you'd prefer a different behavior.
Describe your environment (please complete the following information):
- OS: Linux
- Python: 3.13.5
- Haystack version: haystack-ai 3.5.0
- Integration version: qdrant-haystack 13.2.0 (also reproduced on
mainat 8249f30), qdrant-client 1.20.0
- Lingua principale
- Python
- Stelle
- 212
- Fork
- 396
- Merge medio
- 2g 9h
- PR unite (30g)
- 95
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di deepset-ai/haystack-core-integrations
-
integration:qdrant P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
deepset-ai/haystack-core-integrations#4228 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Qdrant: `in` filter with an empty list matches all documents (delete_by_filter deletes everything)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
deepset-ai/haystack-core-integrations#4334 ·
I maintainer di solito rispondono entro 1 giorno
-
FAISS: filtered search misses matching documents outside the first top_k * 10 neighboursForse già presa @davidsbatista l’ha presa 2 giorni fa. Aperta
deepset-ai/haystack-core-integrations#4322 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Add Late Interaction Qdrant RetrieverForse già presa @anakin87 l’ha presa 6 giorni fa. Aperta
deepset-ai/haystack-core-integrations#4307 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Ollama - `OllamaChatGenerator` returns `finish_reason=None` when output is truncated (`done_reason="length"`)Forse già presa @davidsbatista l’ha presa 6 giorni fa. Aperta
deepset-ai/haystack-core-integrations#4302 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di deepset-ai/haystack-core-integrations
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
micronaut-projects/micronaut-core#14585 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
langgenius/graphon#443 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
[BUG]: Management endpoints /v1/memory/stats and /v1/memory/counts bypass API key authenticationAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
docling-project/docling-serve#788 ·
I maintainer di solito rispondono entro 1 giorno
-
Mend: dependency security vulnerability untriaged
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
opensearch-project/cross-cluster-replication#1805 ·
I maintainer di solito rispondono entro 1 giorno