milvus-io / milvus

A cloud-native vector database, storage for next generation AI applications
https://milvus.io
Apache License 2.0
30.4k stars 2.92k forks source link

[Bug]: The Milvus Java SDK occasionally returns a null object when calling MilvusClientV2Pool.getClient("MME"), even if there are many available connections in the pool, the NullPointerException will still happen. #37188

Open xiaojunxiang2023 opened 2 weeks ago

xiaojunxiang2023 commented 2 weeks ago

Is there an existing issue for this?

Environment

Milvus Server: 2.4.11
Milvus sdk: java-sdk 2.4.3

Current Behavior

The Milvus Java SDK occasionally returns a null object when calling MilvusClientV2Pool.getClient("MME"), even if there are many available connections in the pool, the NullPointerException will still happen.

image

1. ActiveClient is 6, IdleClient is 0, less than the TotalPerKey(50)

image

2. When request 1 is stuck during client.createCollection, and request 2 comes in and executes MilvusClientV2Pool.getClient("MME"), it receives a null object.

image

Expected Behavior

In situations where the connection pool is not full, it should not return a null object.

Steps To Reproduce

No response

Milvus Log

No response

Anything else?

No response

yanliang567 commented 2 weeks ago

/assign @yhmo /unassign

xiaofan-luan commented 2 weeks ago

I don't think it make sense to return null to user.

when get connect and no available connections, we should just block and wait for a valid connection.

Anyone interested in this?