-
Notifications
You must be signed in to change notification settings - Fork 183
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
Reusable async client #639
Reusable async client #639
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #639 +/- ##
==========================================
- Coverage 72.12% 72.10% -0.02%
==========================================
Files 89 89
Lines 7939 7949 +10
==========================================
+ Hits 5726 5732 +6
- Misses 2213 2217 +4 ☔ View full report in Codecov by Sentry. |
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! Thanks.
Double checking that the synchronous client doesn't have this issue?
Does the client support with
(too lazy to look) :))
Turns out the issue affects clients using I discovered this by adding test for the synchronous client, which apparently uses |
d3ba99c
to
26f148f
Compare
Hello @odelmarcelle , please put your test here for RequestsHttpConnection. And also DCO is failing. Please fix it. Thank you. |
Signed-off-by: odlmarce <[email protected]>
Signed-off-by: odlmarce <[email protected]>
Signed-off-by: odlmarce <[email protected]>
Signed-off-by: odlmarce <[email protected]>
Signed-off-by: odlmarce <[email protected]>
Signed-off-by: odlmarce <[email protected]>
…after `close` Signed-off-by: odlmarce <[email protected]>
Signed-off-by: odlmarce <[email protected]>
26f148f
to
9193f3f
Compare
Resolved the DCO. @saimedhi AFAIK, the test won't work there as there's not connection established to an opensearch instance. It should be somewhere under /test_server/, right? I didn't manage to work it out by myself. One last comment though: Why are there two async connection classes defined? I'm not too sure to understand why |
80be9a8
to
088e705
Compare
Signed-off-by: odlmarce <[email protected]>
Signed-off-by: odlmarce <[email protected]>
088e705
to
d4edaa1
Compare
self._create_urllib3_pool() | ||
|
||
def _create_urllib3_pool(self) -> None: | ||
self.pool = self._urllib3_pool_factory() # type: ignore |
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.
Should we be a bit defensive here and add assert _urllib3_pool_factory is not None
?
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.
I'm not sure to see how that would help. _urllib3_pool_factory
will never be None
?
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.
Yes, you're right, its creation is in the constructor.
LMK if you prefer to merge as is, or if you think adding that |
Description
Clears out the
session
attribute ofAsyncHttpConnection
andAIOHttpConnection
when callingclose()
, which allow re-using a previously closedAsyncOpensearch
instance.Issues Resolved
Closes #637
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.