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

[DOC] Is OpenSearch python client thread safe? #753

Open
Shodded opened this issue May 28, 2024 · 1 comment
Open

[DOC] Is OpenSearch python client thread safe? #753

Shodded opened this issue May 28, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Shodded
Copy link

Shodded commented May 28, 2024

Versions
Client - opensearch-py = "2.5.0"
AWS serverless = 2.0.x

Describe the issue:
Is the OpenSearch client with connection_class=Urllib3HttpConnection thread-safe?

As part of adopting OpenSearch in our Python repository, we aim to verify whether the client configured with connection_class=Urllib3HttpConnection is thread-safe. We have noted that perform_request utilizes Urllib3's connection pool, which is known to be thread-safe. However, we have found no additional documentation that clarifies this issue further.

Configuration:

OpenSearch(
            hosts=[(host=host, port=port)],
            http_auth=Urllib3AWSV4SignerAuth(credentials, AWS_REGION, "aoss"),
            use_ssl=True,
            verify_certs=True,
            connection_class=Urllib3HttpConnection,
            retry_on_timeout=True
        )
@Shodded Shodded added bug Something isn't working untriaged Need triage labels May 28, 2024
@saimedhi saimedhi removed the untriaged Need triage label May 28, 2024
@dblock
Copy link
Member

dblock commented May 28, 2024

This is a good question. AFAIK it is, I believe it was used across a thread pool in https://github.com/opensearch-project/OpenSearch-benchmark, but I am not 100% sure. How about we clarify this? Want to write a mutlithreaded sample and contribute it to https://github.com/opensearch-project/opensearch-py/tree/main/samples?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants