You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(client): add Close() and close bulk indexer's implicit client (#932)
Backport #926 to v4 without the default-client cache.
Add Close() to opensearch.Client and opensearchapi.Client so callers can
release the transport's background goroutines and idle connections.
NewBulkIndexer now closes the client it creates when the caller supplies
none, on all Close paths including a cancelled context. Its flusher stops
via context cancellation instead of a done channel, so Close no longer
risks a deadlock when the flusher has already exited.
The process-wide client cache and its metrics-aggregation behavior are left
out, so this stays a non-breaking maintenance change.
Refs: #893Fixes: #928
Signed-off-by: Ryan Yuan <ryan.yuan@crowdstrike.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
6
6
7
7
### Added
8
8
9
+
- Add `Close()` to `opensearch.Client` and `opensearchapi.Client` to release background goroutines (node discovery, health/stats pollers, DNS refresh) and idle connections; `opensearchutil.NewBulkIndexer` now closes the client it implicitly creates. Backport of #926 without the default-client cache ([#928](https://github.com/opensearch-project/opensearch-go/issues/928), [#893](https://github.com/opensearch-project/opensearch-go/issues/893))
9
10
- Add `cmd/osgen` code generator for typed path builders and API consumer files from the OpenAPI spec
10
11
- v5preview/opensearchapi: `NewClient` and `NewDefaultClient` now inject `opensearchtransport.NewDefaultRouter` when `config.Client.Router` is nil, opting every v5preview client into intelligent request routing by default. The `OPENSEARCH_GO_ROUTER` env var preserves its v4 semantics end-to-end: `=true`/`=1` enables auto-discovery (via `DiscoverNodesOnStart`); `=false`/`=0` suppresses both Router injection and auto-discovery; unset injects the Router without auto-discovery. v4's `opensearchapi.NewClient` is unchanged. ([#816](https://github.com/opensearch-project/opensearch-go/issues/816))
11
12
- Add `envvars.Falsy(name)` helper that distinguishes "explicitly opted out" from "unset" (Truthy collapses both into false). Used by v5preview's router injection rule.
0 commit comments