Adding Exception handling for MilvusClient V2 #1671
Adding Exception handling for MilvusClient V2 #1671sre-ci-robot merged 6 commits intomilvus-io:masterfrom
Conversation
|
Welcome @divyaruhil! It looks like this is your first PR to milvus-io/milvus-sdk-java 🎉 |
d42009d to
a7a11ab
Compare
|
@divyaruhil |
40bc29e to
a7a11ab
Compare
7d752fc to
7940145
Compare
|
Hi @yhmo , thankyou for reviewing, i have made the required changes. |
|
Hi @divyaruhil |
|
Hi @yhmo , can u pls point me out what error code and timeout values you are referring to ? I am only able to see one review comment which is this one #1671 (comment). |
0d5f00d to
081ebe6
Compare
|
Hi @yhmo, Thanks for sharing the screenshot! It seems there might be a small glitch — I’m unable to view your review comments on my side. |
…ilvusClientV2 Signed-off-by: Divya <DIVYA2@ibm.com>
Signed-off-by: Divya <DIVYA2@ibm.com>
Signed-off-by: Divya <DIVYA2@ibm.com>
Signed-off-by: Divya <DIVYA2@ibm.com>
Signed-off-by: Divya <DIVYA2@ibm.com>
e7e6734 to
26d8260
Compare
The ConnectConfig class has a member named "proxyAddress", user can assign a proxy address as a string. The proxyAddress is passed into the ManagedChannelBuilder by the configureProxy() method, when user wants to connect the milvus server via a proxy server. When user has a proxy server, the connection between the client and milvus server might be unreachable. |
|
Thanks @yhmo for the clarification. I wanted to share that I've actually tested the current implementation with proxyAddress configurations, and it's working correctly with all the validation methods. As per my knowledge , Proxy configuration is managed at the HTTP/gRPC client layer, not at the individual socket connection level. When a proxy is configured, the actual TCP connection establishes with the proxy server, which then forwards traffic to the final destination . My current validation methods (validateHostname, validatePort, validateCert) are specifically designed to verify the final Milvus server destination. |
Signed-off-by: Divya <DIVYA2@ibm.com>
Ok, sounds good. I will merge this pr into the source code and cherry-pick it to the 2.6 branch. Thank you! |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: divyaruhil, yhmo The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
* Adding Exception handling for validating hostname, port and cert in MilvusClientV2 Signed-off-by: Divya <DIVYA2@ibm.com> * Addressing review comments Signed-off-by: Divya <DIVYA2@ibm.com> * formatting correction Signed-off-by: Divya <DIVYA2@ibm.com> * Addressing review comments Signed-off-by: Divya <DIVYA2@ibm.com> * fixing compilation error Signed-off-by: Divya <DIVYA2@ibm.com> * Corrected validateCert implementation Signed-off-by: Divya <DIVYA2@ibm.com> --------- Signed-off-by: Divya <DIVYA2@ibm.com> Co-authored-by: Divya <DIVYA2@ibm.com>
* Adding Exception handling for validating hostname, port and cert in MilvusClientV2 * Addressing review comments * formatting correction * Addressing review comments * fixing compilation error * Corrected validateCert implementation --------- Signed-off-by: Divya <DIVYA2@ibm.com> Co-authored-by: Divya <117009486+divyaruhil@users.noreply.github.com> Co-authored-by: Divya <DIVYA2@ibm.com>







Currently, milvus-java-sdk returns generic DEADLINE_EXCEEDED error for all connection-related issues (invalid host, wrong port, or certificate errors).
This makes it difficult to identify the root cause .
DEADLINE_EXCEEDED: CallOptions deadline exceeded after 7.780172042s. Name resolution delay 2.199438000 seconds. [closed=[], open=[[wait_for_ready, buffered_nanos=7788263209, waiting_for_connection]]]As per our discussion, there’s no direct way to unwrap specific exceptions for MilvusClientV2.
This PR introduces enhanced exception handling to validate and provide clearer error messages for invalid hostname, port, and certificate issues in MilvusClientV2.
Fix for issue