opensearch-project / opensearch-k8s-operator

OpenSearch Kubernetes Operator
Apache License 2.0
385 stars 202 forks source link

Disable http client connection reuse to prevent memory leak #842

Closed swoehrl-mw closed 3 months ago

swoehrl-mw commented 3 months ago

Description

The operator pod is suffering from memory leaks. After some analysis I think I have narrowed it down to connections for the http client being kept for reuse but never being used due to a new client being created in every reconcile run. This PR disables the connection keepalive/reuse and (at least in my experiments) prevents the memory leak.

Issues Resolved

Fixes #700

Check List

If CRDs are changed:

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.

swoehrl-mw commented 3 months ago

@prudhvigodithi @salyh Can I get a review+approval here please?

prudhvigodithi commented 3 months ago

Thanks @swoehrl-mw I will take a look at this today.

prudhvigodithi commented 3 months ago

Thanks @swoehrl-mw I have added my comments can you please check, this is an important change that should be shipped. Adding @salyh @getsaurabh02