-
Notifications
You must be signed in to change notification settings - Fork 25k
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
getRemoteClusterClient
does not need a ThreadPool
#104557
getRemoteClusterClient
does not need a ThreadPool
#104557
Conversation
We necessarily have access to a `TransportService` when building a remote-cluster client, and the `TransportService` itself has a `ThreadPool`, so there's no need to pass in a specific `ThreadPool` when building a remote-cluster client. Relates elastic#104536
Pinging @elastic/es-core-infra (Team:Core/Infra) |
What is the harm in being explicit here? Piggy-backing access to services from other services has made refactoring in the past especially difficult. |
Ultimately there's no need for a remote-cluster client to have a In fact |
The number of places extracting threadpool from client is daunting...though the two main uses seem to be (from a skim of findings in intellij) constructing another client, and getting at the threadcontext. For the latter, I wonder if we should rethink how to get at threadcontext. It's only loosely related to threadpool, in that we create a single threadpool, and it has to do with threading. You could imagine the threadcontext itself being available as a static or threadlocal, or better yet, something like the new ScopedValues that are in preview in newer versions of Java. With that all said, I realize the above is not trivial, so I think this is ok as a stepping stone. |
On reflection if we do #104536 first then that removes the objections to this change, because that PR renders this |
Following #104536 this argument is now unused.