Skip to content

Commit 47d2e2a

Browse files
Fork per-node query action to search_coordination pool
The runtime of this action can heavily depend on the number of shards queried, how quickly queries execute and how likely the can_match we execute during the query phase is to return `false`. As we shouldn't have O(n) cost tasks that may run unpredictably long, lets fork this to search_coordination like we do for can_match and field_caps which both have similar runtime cost.
1 parent d5c0778 commit 47d2e2a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/src/main/java/org/elasticsearch/action/search/SearchQueryThenFetchAsyncAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ static void registerNodeSearchAction(
559559
final int searchPoolMax = threadPool.info(ThreadPool.Names.SEARCH).getMax();
560560
transportService.registerRequestHandler(
561561
NODE_SEARCH_ACTION_NAME,
562-
EsExecutors.DIRECT_EXECUTOR_SERVICE,
562+
threadPool.executor(ThreadPool.Names.SEARCH_COORDINATION),
563563
NodeQueryRequest::new,
564564
(request, channel, task) -> {
565565
final CancellableTask cancellableTask = (CancellableTask) task;

0 commit comments

Comments
 (0)