Skip to content

Fix a bug of ClientPool that rpc channel is not properly closed#1756

Merged
sre-ci-robot merged 1 commit intomilvus-io:masterfrom
yhmo:ma
Feb 12, 2026
Merged

Fix a bug of ClientPool that rpc channel is not properly closed#1756
sre-ci-robot merged 1 commit intomilvus-io:masterfrom
yhmo:ma

Conversation

@yhmo
Copy link
Copy Markdown
Contributor

@yhmo yhmo commented Feb 12, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 12, 2026 02:58
@sre-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: yhmo

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

The pull request process is described 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

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to fix resource-leak/cleanup behavior in the client pool so underlying RPC channels can be properly closed, and updates an example to reliably close pooled and non-pooled clients.

Changes:

  • Make the ClientCache scheduler thread a daemon thread.
  • On timer stop, return cached active/retired clients back to the underlying pool to enable proper destruction/closure.
  • Update ConsistencyLevelExample to ensure MilvusClientV2Pool and the static MilvusClientV2 are closed.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
sdk-core/src/main/java/io/milvus/pool/ClientCache.java Adjusts scheduler thread behavior and attempts to return cached clients to the pool during shutdown.
examples/src/main/java/io/milvus/v2/ConsistencyLevelExample.java Ensures pool/client resources are closed via finally and at program end.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread sdk-core/src/main/java/io/milvus/pool/ClientCache.java Outdated
Comment thread sdk-core/src/main/java/io/milvus/pool/ClientCache.java
Comment thread examples/src/main/java/io/milvus/v2/ConsistencyLevelExample.java Outdated
Signed-off-by: yhmo <yihua.mo@zilliz.com>
@yhmo yhmo added the lgtm label Feb 12, 2026
@sre-ci-robot sre-ci-robot merged commit d7a6aff into milvus-io:master Feb 12, 2026
5 checks passed
@yhmo yhmo deleted the ma branch February 12, 2026 07:51
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.

3 participants