Skip to content

Comments

refactor: persistent Milvus connection for server and server-https#44

Open
Shriiii01 wants to merge 1 commit intokubeflow:mainfrom
Shriiii01:refactor/milvus-persistent-connection
Open

refactor: persistent Milvus connection for server and server-https#44
Shriiii01 wants to merge 1 commit intokubeflow:mainfrom
Shriiii01:refactor/milvus-persistent-connection

Conversation

@Shriiii01
Copy link

  • Initialize Milvus connection once at app startup (main() for WebSocket, lifespan for FastAPI)
  • Reuse connection in milvus_search() instead of connect/disconnect per request
  • Disconnect only on app shutdown (finally block / lifespan teardown)
  • Add optional reconnection retry in milvus_search() for intermittent drops

Fixes #28

- Initialize Milvus connection once at app startup (main() for WebSocket, lifespan for FastAPI)
- Reuse connection in milvus_search() instead of connect/disconnect per request
- Disconnect only on app shutdown (finally block / lifespan teardown)
- Add optional reconnection retry in milvus_search() for intermittent drops

Fixes kubeflow#28

Co-authored-by: Cursor <cursoragent@cursor.com>
@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign franciscojavierarceo for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement connection pooling for Milvus

1 participant