Skip to content

Correct context for ClusterConnManager listener #83035

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

Conversation

DaveCTurner
Copy link
Contributor

Today ClusterConnectionManager#connectToNode completes its listeners
in the thread context in which the connection completes, which may not
be the correct context if there are multiple concurrent connection
attempts. With this commit we make sure to complete each listener in the
context in which it was passed to the corresponding call to
connectToNode.

Today `ClusterConnectionManager#connectToNode` completes its listeners
in the thread context in which the connection completes, which may not
be the correct context if there are multiple concurrent connection
attempts. With this commit we make sure to complete each listener in the
context in which it was passed to the corresponding call to
`connectToNode`.
@DaveCTurner DaveCTurner added >bug :Distributed Coordination/Network Http and internode communication implementations v8.0.0 v8.1.0 v7.17.1 labels Jan 25, 2022
@elasticmachine elasticmachine added the Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. label Jan 25, 2022
@elasticmachine
Copy link
Collaborator

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

@elasticsearchmachine
Copy link
Collaborator

Hi @DaveCTurner, I've created a changelog YAML for you.

@idegtiarenko
Copy link
Contributor

@elasticmachine please run elasticsearch-ci/rest-compatibility

@DaveCTurner DaveCTurner marked this pull request as ready for review January 26, 2022 14:41
@DaveCTurner
Copy link
Contributor Author

#83170 will fix the failure

@elasticmachine please run elasticsearch-ci/part-1

Copy link
Contributor

@original-brownbear original-brownbear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Are we sure about backporting to 7.17 though? I can't think of a bug this would cause?

@DaveCTurner DaveCTurner merged commit 39b3cb8 into elastic:master Jan 26, 2022
@DaveCTurner DaveCTurner deleted the 2022-01-25-ClusterConnectionManager-thread-context branch January 26, 2022 19:22
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
8.0 Commit could not be cherrypicked due to conflicts
7.17 Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 83035

@DaveCTurner
Copy link
Contributor Author

Are we sure about backporting to 7.17 though? I can't think of a bug this would cause?

Yeah it might not be a real bug, at least not right now, but also not a controversial bugfix so worth the backport IMO.

DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Jan 26, 2022
Today `ClusterConnectionManager#connectToNode` completes its listeners
in the thread context in which the connection completes, which may not
be the correct context if there are multiple concurrent connection
attempts. With this commit we make sure to complete each listener in the
context in which it was passed to the corresponding call to
`connectToNode`.

Co-authored-by: ievgen.degtiarenko <ievgen.degtiarenko@elastic.co>
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Jan 26, 2022
Today `ClusterConnectionManager#connectToNode` completes its listeners
in the thread context in which the connection completes, which may not
be the correct context if there are multiple concurrent connection
attempts. With this commit we make sure to complete each listener in the
context in which it was passed to the corresponding call to
`connectToNode`.

Co-authored-by: ievgen.degtiarenko <ievgen.degtiarenko@elastic.co>
elasticsearchmachine pushed a commit that referenced this pull request Jan 27, 2022
* Correct context for ClusterConnManager listener (#83035)

Today `ClusterConnectionManager#connectToNode` completes its listeners
in the thread context in which the connection completes, which may not
be the correct context if there are multiple concurrent connection
attempts. With this commit we make sure to complete each listener in the
context in which it was passed to the corresponding call to
`connectToNode`.

Co-authored-by: ievgen.degtiarenko <ievgen.degtiarenko@elastic.co>

* Missing import

* Missed one

Co-authored-by: ievgen.degtiarenko <ievgen.degtiarenko@elastic.co>
elasticsearchmachine pushed a commit that referenced this pull request Jan 27, 2022
* Correct context for ClusterConnManager listener (#83035)

Today `ClusterConnectionManager#connectToNode` completes its listeners
in the thread context in which the connection completes, which may not
be the correct context if there are multiple concurrent connection
attempts. With this commit we make sure to complete each listener in the
context in which it was passed to the corresponding call to
`connectToNode`.

Co-authored-by: ievgen.degtiarenko <ievgen.degtiarenko@elastic.co>

* Missing import

* Fix up tests

Co-authored-by: ievgen.degtiarenko <ievgen.degtiarenko@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Distributed Coordination/Network Http and internode communication implementations Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. v7.17.0 v8.0.0 v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants