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

Close idle connections on the http client directly #2755

Merged
merged 1 commit into from
Mar 23, 2020

Conversation

sebgl
Copy link
Contributor

@sebgl sebgl commented Mar 23, 2020

I realized while refactoring this piece of code for being used by
another controller that we don't need to keep track of the
http.Transport, since calling Close() on the client propagates
to the underlying transport directly.

This simplifies the ES client structure a little bit, and will be useful
for the refactoring I'm working on.

To make sure this still works as expected, I tested the goroutine leaks using
the methodology outlined in this comment. Closing the client has the same effect
as closing the underlying transport.

I realized while refactoring this piece of code for being used by
another controller that we don't need to keep track of the
http.Transport, since calling Close() on the client propagates the close
to the underlying transport directly.

This simplifies the ES client structure a little bit, and will be useful
for the refactoring I'm working on.
@sebgl sebgl merged commit 865714f into elastic:master Mar 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants