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

Consider exposing a Close function on elasticsearch.Client #875

Open
codefromthecrypt opened this issue Jun 7, 2024 · 0 comments
Open

Comments

@codefromthecrypt
Copy link

elasticsearch.Client should consider a Close function as its elastictransport.Client does a couple things, which at least for unit tests may be best to stop explicitly. We may also want to accept a context on New for similar reasons.

Starts the goroutine client.DiscoverNodes: This may want to be cancelable, e.g. passing a context to the New function. Agree this is not typical, but personally I pass ctx into New functions that perform I/O.

Via elastic-transport-go, starts a self-scheduling function for discovery: On Close, this should be stopped explicitly somehow, or documented why that's not required.

I didn't mention the edge case of http transport, that we have an opportunity to CloseIdleConnections, as I think above are more important to rule in or out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant