-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
fix: fix client concurrent issue #752
Conversation
Codecov Report
@@ Coverage Diff @@
## main #752 +/- ##
==========================================
+ Coverage 80.41% 81.78% +1.37%
==========================================
Files 17 17
Lines 1205 1208 +3
==========================================
+ Hits 969 988 +19
+ Misses 236 220 -16
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
client/clip_client/client.py
Outdated
|
||
def _gather_result(self, r): | ||
def _gather_result(self, r, results): |
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.
def _gather_result(self, r, results): | |
def _gather_result(self, response, results: 'DocumentArray'): |
client/clip_client/client.py
Outdated
def _unboxed_result(self): | ||
if self._results.embeddings is None: | ||
@staticmethod | ||
def _unboxed_result(results, return_plain): |
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.
def _unboxed_result(results, return_plain): | |
def _unboxed_result(results, return_plain: bool): |
498e41f
to
c838520
Compare
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.
LGTM
In the original client implementation, it uses a global result variable to store all results from the server. This may break with the async client in that it can not distinguish the source of input and thus mix all concurrent requests and return the wrong results.
This PR fixes the above issue.