Skip to content

fix: OpenSearch async client initialization#2645

Merged
davidsbatista merged 13 commits into
deepset-ai:mainfrom
Nitro963:async-opensearch-init
Jan 5, 2026
Merged

fix: OpenSearch async client initialization#2645
davidsbatista merged 13 commits into
deepset-ai:mainfrom
Nitro963:async-opensearch-init

Conversation

@Nitro963
Copy link
Copy Markdown
Contributor

@Nitro963 Nitro963 commented Jan 1, 2026

Proposed Changes:

In async environment _ensure_initialized sync method is being called on the main thread, and as it may take time depending on network it will cause the entire event loop to block and the application will freeze until all retries finished if any.

How did you test it?

Manual testing within FastAPI async server

@Nitro963 Nitro963 requested a review from a team as a code owner January 1, 2026 09:42
@Nitro963 Nitro963 requested review from davidsbatista and removed request for a team January 1, 2026 09:42
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jan 1, 2026

CLA assistant check
All committers have signed the CLA.

@davidsbatista
Copy link
Copy Markdown
Contributor

Thanks for your proposal @Nitro963

This makes sense, but I would rather do it differently, since this might introduce lots of overhead each time an operation is performed.

Ideally, creating a async def _ensure_initialized_async(self) check how it's done for the Chroma document store.

@Nitro963
Copy link
Copy Markdown
Contributor Author

Nitro963 commented Jan 4, 2026

@davidsbatista I've updated implementation with a new initialization method

@davidsbatista
Copy link
Copy Markdown
Contributor

thanks @Nitro963 LGTM

Copy link
Copy Markdown
Contributor

@davidsbatista davidsbatista left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@davidsbatista davidsbatista merged commit 920c8e2 into deepset-ai:main Jan 5, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants