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
Ensure the correct threadContext for RemoteClusterNodesAction #101050
Conversation
RemoteClusterNodesAction fetches NodesInfo with system context. It must restore the original caller's context when respond back. This PR ensures that.
Pinging @elastic/es-distributed (Team:Distributed) |
Hi @ywangd, I've created a changelog YAML for you. |
There was a problem hiding this 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) |
There was a problem hiding this comment.
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.
RemoteClusterNodesAction fetches NodesInfo with system context. It must restore the original caller's context when respond back. This PR ensures that.