Skip to content

Commit 56606ed

Browse files
snemesdblock
andauthored
Set enable_cleanup_closed=True to drop TLS connections without a shutdown (opensearch-project#468)
* Set enable_cleanup_closed=True to drop TLS connections without a shutdown AsyncOpenSearch seems to leak TLS connections due to a missing parameter in `aiohttp.TCPConnector`. This causes opensearch-project#172 and was also fixed "upstream" in this issue elastic/elasticsearch-py#1910. Signed-off-by: Sandor Nemes <snemes@users.noreply.github.com> * Update CHANGELOG.md Signed-off-by: Sandor Nemes <snemes@users.noreply.github.com> --------- Signed-off-by: Sandor Nemes <snemes@users.noreply.github.com> Signed-off-by: Daniel (dB.) Doubrovkine <dblock@amazon.com> Co-authored-by: Daniel (dB.) Doubrovkine <dblock@amazon.com>
1 parent 56c96d7 commit 56606ed

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
2525
- Use API generator for all APIs ([#551](https://github.com/opensearch-project/opensearch-py/pull/551))
2626
- Merge `.pyi` type stubs inline ([#563](https://github.com/opensearch-project/opensearch-py/pull/563))
2727
- Expanded type coverage to benchmarks, samples and tests ([#566](https://github.com/opensearch-project/opensearch-py/pull/566))
28+
- Defaulted `enable_cleanup_closed=True` in `aiohttp.TCPConnector` to prevent TLS connection leaks ([#468](https://github.com/opensearch-project/opensearch-py/pull/468))
2829
### Deprecated
2930
- Deprecated point-in-time APIs (list_all_point_in_time, create_point_in_time, delete_point_in_time) and Security Client APIs (health_check and update_audit_config) ([#502](https://github.com/opensearch-project/opensearch-py/pull/502))
3031
### Removed
@@ -162,4 +163,4 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
162163
[2.2.0]: https://github.com/opensearch-project/opensearch-py/compare/v2.1.1...v2.2.0
163164
[2.3.0]: https://github.com/opensearch-project/opensearch-py/compare/v2.2.0...v2.3.0
164165
[2.3.1]: https://github.com/opensearch-project/opensearch-py/compare/v2.3.0...v2.3.1
165-
[2.3.2]: https://github.com/opensearch-project/opensearch-py/compare/v2.3.1...v2.3.2
166+
[2.3.2]: https://github.com/opensearch-project/opensearch-py/compare/v2.3.1...v2.3.2

opensearchpy/_async/http_aiohttp.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,10 @@ async def _create_aiohttp_session(self) -> Any:
376376
cookie_jar=aiohttp.DummyCookieJar(),
377377
response_class=OpenSearchClientResponse,
378378
connector=aiohttp.TCPConnector(
379-
limit=self._limit, use_dns_cache=True, ssl=self._ssl_context
379+
limit=self._limit,
380+
use_dns_cache=True,
381+
enable_cleanup_closed=True,
382+
ssl=self._ssl_context,
380383
),
381384
trust_env=self._trust_env,
382385
)

0 commit comments

Comments
 (0)