Skip to content
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

Switching to the default connection class to address slower connection with RequestsHttpConnection #411

Merged
merged 3 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions osbenchmark/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,10 @@ def create(self):
credentials = Credentials(access_key=self.aws_log_in_dict["aws_access_key_id"],
secret_key=self.aws_log_in_dict["aws_secret_access_key"],
token=self.aws_log_in_dict["aws_session_token"])
aws_auth = opensearchpy.AWSV4SignerAuth(credentials, self.aws_log_in_dict["region"],
aws_auth = opensearchpy.Urllib3AWSV4SignerAuth(credentials, self.aws_log_in_dict["region"],
self.aws_log_in_dict["service"])
return opensearchpy.OpenSearch(hosts=self.hosts, use_ssl=True, verify_certs=True, http_auth=aws_auth,
connection_class=opensearchpy.RequestsHttpConnection)
connection_class=opensearchpy.Urllib3HttpConnection)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI this is now the default and you could remove this option if you want to. Doesn't hurt to keep it either.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @dblock , so if we just use opensearch-py-2.4.1 then we don't need to explicitly specify connection_class parameter?

Copy link
Member

@dblock dblock Dec 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but specifying it explicitly doesn't hurt.


def create_async(self):
# pylint: disable=import-outside-toplevel
Expand Down
2 changes: 1 addition & 1 deletion osbenchmark/utils/opts.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def normalize_to_dict(arg):
defined as a json string or file.
"""
# pylint: disable=import-outside-toplevel
from opensearchpy.client import _normalize_hosts
from opensearchpy.client.utils import _normalize_hosts
return {TargetHosts.DEFAULT: _normalize_hosts(arg)}

self.parsed_options = to_dict(self.argvalue, default_parser=normalize_to_dict)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def str_from_file(name):
# transitive dependencies:
# urllib3: MIT
# aiohttp: Apache 2.0
"opensearch-py[async]==2.3.2",
"opensearch-py[async]==2.4.1",
# License: BSD
"psutil==5.8.0",
# License: MIT
Expand Down
Loading