-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MilvusClientV2Pool getClient method and PoolClientFactory create method should throw exception #1168
Comments
Agreed. Usually what we do in java is to create exception instead of return null. |
Similar to #1118 |
Fixed by this pr: https://github.com/milvus-io/milvus-sdk-java/pull/1170/files |
Good job and PoolClientFactory create method should thrown exception too:
On the other way when validateObject method exception occour can return false? |
I don't intend to change the methods of PoolClientFactory. It derived from BaseKeyedPooledObjectFactory and implemented the virtual functions such as create/destroyObject/validateObject/activateObject. https://commons.apache.org/proper/commons-pool/apidocs/src-html/org/apache/commons/pool2/BaseKeyedPooledObjectFactory.html ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// The getObject() is a simple method directly returns the MilvusClient object, doesn't throw any exceptions.
|
If create(String key) method ignore the exception ,the caller will not known the reason that cause the exception ,and null but really is milvus server is invalidate,will misleading and confusing users, so the exception should be thrown. If an invalidate excepetion occur , destroy the invalidate object is right. |
This pr will throw the exception for create()/validateObject(): #1172 |
MilvusClientV2Pool getClient(String key) should throw the exception when exception occured:
PoolClientFactory create(String key) should throw the exception when exception occured:
The text was updated successfully, but these errors were encountered: