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

Ensure the correct threadContext for RemoteClusterNodesAction #101050

Merged

Conversation

ywangd
Copy link
Member

@ywangd ywangd commented Oct 18, 2023

RemoteClusterNodesAction fetches NodesInfo with system context. It must restore the original caller's context when respond back. This PR ensures that.

RemoteClusterNodesAction fetches NodesInfo with system context. It must
restore the original caller's context when respond back. This PR ensures
that.
@ywangd ywangd added >bug :Distributed/Network Http and internode communication implementations v8.12.0 labels Oct 18, 2023
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine elasticsearchmachine added the Team:Distributed Meta label for distributed team label Oct 18, 2023
@elasticsearchmachine
Copy link
Collaborator

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

Copy link
Contributor

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

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

LGTM (one optional nit tho)

executeWithSystemContext(
request,
threadContext,
new ContextPreservingActionListener<>(threadContext.newRestorableContext(true), listener)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest using org.elasticsearch.action.support.ContextPreservingActionListener#wrapPreservingContext here.

@ywangd ywangd added the auto-merge Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Oct 19, 2023
@elasticsearchmachine elasticsearchmachine merged commit c9835b8 into elastic:main Oct 19, 2023
13 checks passed
@ywangd ywangd deleted the remote-nodes-action-preserve-context branch October 19, 2023 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) >bug :Distributed/Network Http and internode communication implementations Team:Distributed Meta label for distributed team v8.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants