diff --git a/server/src/main/java/org/elasticsearch/action/fieldcaps/TransportFieldCapabilitiesAction.java b/server/src/main/java/org/elasticsearch/action/fieldcaps/TransportFieldCapabilitiesAction.java index 917f3ca35de91..479eecaa2cc16 100644 --- a/server/src/main/java/org/elasticsearch/action/fieldcaps/TransportFieldCapabilitiesAction.java +++ b/server/src/main/java/org/elasticsearch/action/fieldcaps/TransportFieldCapabilitiesAction.java @@ -74,7 +74,7 @@ public TransportFieldCapabilitiesAction(TransportService transportService, final Set metadataFields = indicesService.getAllMetadataFields(); this.metadataFieldPred = metadataFields::contains; - transportService.registerRequestHandler(ACTION_NODE_NAME, ThreadPool.Names.MANAGEMENT, + transportService.registerRequestHandler(ACTION_NODE_NAME, ThreadPool.Names.SEARCH_COORDINATION, FieldCapabilitiesNodeRequest::new, new NodeTransportHandler()); transportService.registerRequestHandler(ACTION_SHARD_NAME, ThreadPool.Names.SAME, FieldCapabilitiesIndexRequest::new, new ShardTransportHandler()); @@ -117,7 +117,7 @@ protected void doExecute(Task task, FieldCapabilitiesRequest request, final Acti localIndices, nowInMillis, concreteIndices, - threadPool.executor(ThreadPool.Names.MANAGEMENT), + threadPool.executor(ThreadPool.Names.SEARCH_COORDINATION), indexResponse -> indexResponses.putIfAbsent(indexResponse.getIndexName(), indexResponse), indexFailures::collect, countDown @@ -167,9 +167,9 @@ private Runnable createResponseMerger(FieldCapabilitiesRequest request, List failures = indexFailures.build(indexResponses.keySet()); if (indexResponses.size() > 0) { if (request.isMergeResults()) { - // fork off to the management pool for merging the responses as the operation can run for longer than is acceptable - // on a transport thread in case of large numbers of indices and/or fields - threadPool.executor(ThreadPool.Names.MANAGEMENT).submit( + // fork off to the search_coordination threadpool for merging the responses as the operation can run for longer + // than is acceptable on a transport thread in case of large numbers of indices and/or fields + threadPool.executor(ThreadPool.Names.SEARCH_COORDINATION).submit( ActionRunnable.supply( listener, () -> merge(indexResponses, request.includeUnmapped(), new ArrayList<>(failures))) diff --git a/server/src/test/java/org/elasticsearch/action/fieldcaps/RequestDispatcherTests.java b/server/src/test/java/org/elasticsearch/action/fieldcaps/RequestDispatcherTests.java index 0e6147deb6dbf..d1db8c15b204e 100644 --- a/server/src/test/java/org/elasticsearch/action/fieldcaps/RequestDispatcherTests.java +++ b/server/src/test/java/org/elasticsearch/action/fieldcaps/RequestDispatcherTests.java @@ -141,7 +141,7 @@ public void testHappyCluster() throws Exception { OriginalIndices.NONE, randomNonNegativeLong(), indices.toArray(new String[0]), - transportService.threadPool.executor(ThreadPool.Names.MANAGEMENT), + transportService.threadPool.executor(ThreadPool.Names.SEARCH_COORDINATION), responseCollector::addIndexResponse, responseCollector::addIndexFailure, responseCollector::onComplete); @@ -211,7 +211,7 @@ public void testRetryThenOk() throws Exception { OriginalIndices.NONE, randomNonNegativeLong(), indices.toArray(new String[0]), - transportService.threadPool.executor(ThreadPool.Names.MANAGEMENT), + transportService.threadPool.executor(ThreadPool.Names.SEARCH_COORDINATION), responseCollector::addIndexResponse, responseCollector::addIndexFailure, responseCollector::onComplete @@ -347,7 +347,7 @@ public void testRetryButFails() throws Exception { OriginalIndices.NONE, randomNonNegativeLong(), indices.toArray(new String[0]), - transportService.threadPool.executor(ThreadPool.Names.MANAGEMENT), + transportService.threadPool.executor(ThreadPool.Names.SEARCH_COORDINATION), responseCollector::addIndexResponse, responseCollector::addIndexFailure, responseCollector::onComplete); @@ -489,7 +489,7 @@ public void testSuccessWithAnyMatch() throws Exception { OriginalIndices.NONE, randomNonNegativeLong(), indices.toArray(new String[0]), - transportService.threadPool.executor(ThreadPool.Names.MANAGEMENT), + transportService.threadPool.executor(ThreadPool.Names.SEARCH_COORDINATION), responseCollector::addIndexResponse, responseCollector::addIndexFailure, responseCollector::onComplete); @@ -598,7 +598,7 @@ public void testStopAfterAllShardsUnmatched() throws Exception { OriginalIndices.NONE, randomNonNegativeLong(), indices.toArray(new String[0]), - transportService.threadPool.executor(ThreadPool.Names.MANAGEMENT), + transportService.threadPool.executor(ThreadPool.Names.SEARCH_COORDINATION), responseCollector::addIndexResponse, responseCollector::addIndexFailure, responseCollector::onComplete @@ -895,7 +895,7 @@ protected void doClose() throws IOException { @SuppressWarnings("unchecked") void sendResponse(TransportResponseHandler handler, TransportResponse resp) { - threadPool.executor(ThreadPool.Names.MANAGEMENT).submit(new AbstractRunnable() { + threadPool.executor(ThreadPool.Names.SEARCH_COORDINATION).submit(new AbstractRunnable() { @Override public void onFailure(Exception e) { throw new AssertionError(e); @@ -909,7 +909,7 @@ protected void doRun() { } void sendFailure(TransportResponseHandler handler, Exception e) { - threadPool.executor(ThreadPool.Names.MANAGEMENT).submit(new AbstractRunnable() { + threadPool.executor(ThreadPool.Names.SEARCH_COORDINATION).submit(new AbstractRunnable() { @Override public void onFailure(Exception e) { throw new AssertionError(e);