# Is OpenSearch python client thread safe?

**URL:** <https://forum.opensearch.org/t/is-opensearch-python-client-thread-safe/19588>\
**Category:** OpenSearch\
**Tags:** all-clients, discuss, configure\
**Created:** [May 28, 2024, 11:10am UTC](https://forum.opensearch.org/t/is-opensearch-python-client-thread-safe/19588 "2024-05-28T11:10:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bloodix](https://avatars.discourse-cdn.com/v4/letter/b/c2a13f/32.png) [@bloodix](https://forum.opensearch.org/u/bloodix)\
**Post date:** [May 28, 2024, 11:10am UTC](https://forum.opensearch.org/t/is-opensearch-python-client-thread-safe/19588/1 "2024-05-28T11:10:36Z")

</div>

**Versions** (relevant - OpenSearch/Dashboard/Server OS/Browser):  
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** :

```auto
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
        )

```

**Relevant Logs or Screenshots** :
