Skip to content

Improve control of outgoing connection lifecycles#77672

Merged
elasticsearchmachine merged 1 commit intoelastic:7.xfrom
DaveCTurner:2021-09-14-releasable-connections-7x
Sep 14, 2021
Merged

Improve control of outgoing connection lifecycles#77672
elasticsearchmachine merged 1 commit intoelastic:7.xfrom
DaveCTurner:2021-09-14-releasable-connections-7x

Conversation

@DaveCTurner
Copy link
Copy Markdown
Member

Today we open connections to other nodes in various places and largely
assume that they remain open as needed, only closing them when applying
a cluster state that removes the remote node from the cluster. This
isn't ideal: we might preserve unnecessary connections to remote nodes
that aren't in the cluster if they never manage to join the cluster, and
we might also disconnect from a node that left the cluster while it's in
the process of re-joining too (see #67873).

With this commit we move to a model in which each user of a connection
to a remote node acquires a reference to the connection that must be
released once it's no longer needed. Connections remain open while there
are any live references, but are now actively closed when all references
are released.

Fixes #67873
Backport of #77295

Today we open connections to other nodes in various places and largely
assume that they remain open as needed, only closing them when applying
a cluster state that removes the remote node from the cluster. This
isn't ideal: we might preserve unnecessary connections to remote nodes
that aren't in the cluster if they never manage to join the cluster, and
we might also disconnect from a node that left the cluster while it's in
the process of re-joining too (see elastic#67873).

With this commit we move to a model in which each user of a connection
to a remote node acquires a reference to the connection that must be
released once it's no longer needed. Connections remain open while there
are any live references, but are now actively closed when all references
are released.

Fixes elastic#67873
Backport of elastic#77295
@DaveCTurner DaveCTurner added >bug :Distributed/Cluster Coordination Cluster formation and cluster state publication, including cluster membership and fault detection. backport v7.16.0 labels Sep 14, 2021
@elasticmachine elasticmachine added the Team:Distributed Meta label for distributed team. label Sep 14, 2021
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

@DaveCTurner DaveCTurner added the auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Sep 14, 2021
@elasticsearchmachine elasticsearchmachine merged commit 4d4f2a9 into elastic:7.x Sep 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport >bug :Distributed/Cluster Coordination Cluster formation and cluster state publication, including cluster membership and fault detection. Team:Distributed Meta label for distributed team. v7.16.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants