[BUG](api): Use /heartbeat path in async client#7215
Open
sanidhyasin wants to merge 1 commit into
Open
Conversation
AsyncFastAPI.heartbeat() requested the empty path "" instead of /heartbeat, so async health checks hit the API root and failed to parse the expected "nanosecond heartbeat" payload even when the server was up. The sync FastAPI client already uses /heartbeat. Align the async client with the sync client and the server contract, and add a regression test.
Reviewer ChecklistPlease leverage this checklist to ensure your code review is thorough before approving Testing, Bugs, Errors, Logs, Documentation
System Compatibility
Quality
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes
Fixes #6870.
AsyncFastAPI.heartbeat()requested the empty path""instead of/heartbeat, soawait chromadb.AsyncHttpClient(...).heartbeat()hit thebase API URL rather than the health endpoint. The response there does not
contain the expected
"nanosecond heartbeat"field, so the async healthcheck raised even when the server was healthy. The sync
FastAPIclientalready uses the correct
/heartbeatpath.AsyncFastAPI.heartbeat()now requests/heartbeat, matching the syncclient and the server contract.
heartbeat()carries.Test plan
How are these changes tested?
pytestfor python,yarn testfor js,cargo testfor rustAdded
test_async_fastapi_heartbeat_uses_heartbeat_pathinchromadb/test/test_client.py, which asserts thatheartbeat()issues aGET /heartbeatrequest and parses thenanosecond heartbeatpayload.Migration plan
None required — this is a client-side path correction with no
forwards/backwards compatibility impact.
Observability plan
None required. The existing
@trace_method("AsyncFastAPI.heartbeat", ...)span is unchanged.
Documentation Changes
None required. The added docstring mirrors the sync client; no user-facing
API documentation changes are needed.