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

Add option to close idle connections for dead nodes #1507

Draft
wants to merge 5 commits into
base: release-branch.v7
Choose a base branch
from

Commits on Jul 8, 2021

  1. Add option to close idle connections for dead nodes

    This commit adds a configuration option `SetCloseIdleConnections` to a
    client. The effect of enabling it is that whenever the Client finds a
    dead node, it will call `CloseIdleConnections` on the underlying HTTP
    transport.
    
    This is useful for.e.g. AWS Elasticsearch Service. When AWS ES
    reconfigures the cluster, it may change the underlying IP addresses
    while keeping the DNS entry stable. If the Client would _not_ close idle
    connections, the underlying HTTP client would re-use existing HTTP
    connections and use the old IP addresses. See #1091 for a discussion of
    this problem.
    
    The commit also illustrates how to connect to an AWS ES cluster in the
    recipes in
    [`recipes/aws-mapping-v4`](https://github.com/olivere/elastic/tree/release-branch.v7/recipes/aws-mapping-v4)
    and
    [`recipts/aws-es-client`](https://github.com/olivere/elastic/tree/release-branch.v7/recipes/aws-es-client).
    See the `ConnectToAWS` method for a blueprint of how to connect to an
    AWS ES cluster.
    
    See #1091
    olivere committed Jul 8, 2021
    Configuration menu
    Copy the full SHA
    6e67487 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    df87c07 View commit details
    Browse the repository at this point in the history
  3. Fix closure

    olivere committed Jul 8, 2021
    Configuration menu
    Copy the full SHA
    36933a4 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    0a35917 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    0d84ad5 View commit details
    Browse the repository at this point in the history