We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 51765b6 commit 22cfb3cCopy full SHA for 22cfb3c
1 file changed
backend/open_webui/routers/retrieval.py
@@ -1698,7 +1698,12 @@ async def process_file(
1698
1699
# External embedding API takes time (5-60s+).
1700
# Subsequent updates use fresh async sessions.
1701
- result = save_docs_to_vector_db(
+ # NOTE: save_docs_to_vector_db is a sync function that
1702
+ # calls asyncio.run_coroutine_threadsafe(..., main_loop).result()
1703
+ # which blocks the calling thread. We MUST run it in a
1704
+ # worker thread to avoid deadlocking the event loop.
1705
+ result = await run_in_threadpool(
1706
+ save_docs_to_vector_db,
1707
request,
1708
docs=docs,
1709
collection_name=collection_name,
0 commit comments