-
Notifications
You must be signed in to change notification settings - Fork 328
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
reuse grpc channel and clean connections #1446
base: master
Are you sure you want to change the base?
Conversation
9ac4dee
to
17b21e3
Compare
e8d87c4
to
7691ad3
Compare
d87c5d1
to
1a215d0
Compare
542e54b
to
7844400
Compare
7844400
to
0018fef
Compare
0018fef
to
18fd399
Compare
/assign @czs007 |
/cc @czs007 |
pymilvus/orm/connections.py
Outdated
timeout = t if isinstance(t, (int, float)) else Config.MILVUS_CONN_TIMEOUT | ||
if gh is None: | ||
gh = GrpcHandler(**kwargs) | ||
t = kwargs.get("timeout") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe kwargs.get("timeout", None)
is better to avoid crash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kwargs.get("timeout") and kwargs.get("timeout", None) are identical
if ( | ||
key in self._connected_alias | ||
and connection_details["address"] == kwargs["address"] | ||
and connection_details["user"] == kwargs["user"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we don't check the password?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
password won't be cached, so unable to check
pymilvus/orm/connections.py
Outdated
return | ||
# Set secure=True if username and password are provided | ||
if len(user) > 0 and len(password) > 0: | ||
kwargs["secure"] = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason we relate the tls
(secure
) with the user
and password
? In fact, authentication with user/password can be done without tls
, see also https://wiki.lfaidata.foundation/display/MIL/MEP+27+--+Support+Basic+Authentication.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this. We don't need to set secure=True for user and password authentication. secure=True is for tls secure connections.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I believe before we were using this as a method for checking. At the moment if host/api is supplied there isnt a way to check if https correct?
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: filip-halt The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
pymilvus/orm/connections.py
Outdated
return | ||
# Set secure=True if username and password are provided | ||
if len(user) > 0 and len(password) > 0: | ||
kwargs["secure"] = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this. We don't need to set secure=True for user and password authentication. secure=True is for tls secure connections.
a43d4f0
to
e1fb9c9
Compare
3206ddb
to
6b17472
Compare
Signed-off-by: Filip Haltmayer <[email protected]>
6b17472
to
733d1da
Compare
This PR: