Skip to content

AsyncQdrantRemote.__init__ performs blocking synchronous HTTP call, stalling the event loop #1167

@ns-github

Description

@ns-github

Description

AsyncQdrantRemote.init makes a blocking synchronous HTTP call via httpx.get() in version_check.py:15 when check_compatibility=True (default), stalling the event loop during client construction.

Root Cause

async_qdrant_remote.py:177 calls get_server_version(), which uses httpx.get() synchronously:

  def get_server_version(rest_uri, rest_headers, auth_provider) -> str | None:
      response = httpx.get(rest_uri, headers=rest_headers, auth=auth_provider)

Additionally, the user-configured timeout is not forwarded to this call.

Impact

  • Blocks the event loop during AsyncQdrantClient(...) construction
  • Network issues (latency, DNS, unreachable server) affect all coroutines on the loop
  • User-configured timeout is not respected

Notes

check_compatibility=False and singleton client patterns are valid workarounds, but constructing an AsyncQdrantClient should be safe to do in an async context by default.

Suggested Fix

Run get_server_version via asyncio.to_thread(), or refactor it as an async call deferred to first use. The sync client (QdrantRemote) is unaffected.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions