Skip to content

Commit 8391103

Browse files
hydrogen666s1monw
authored andcommitted
Use executor SAME to handle search related handlers (#37427)
The executor was missed in the backport of #33732- Due to the internal forking to search or search_throttled threadpool there is no reason to fork to the search thread pool twice. Closes #37392 Relates to #33732
1 parent 76aa201 commit 8391103

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ public void messageReceived(ShardSearchTransportRequest request, TransportChanne
359359
TransportActionProxy.registerProxyActionWithDynamicResponseType(transportService, QUERY_ACTION_NAME,
360360
(request) -> ((ShardSearchRequest)request).numberOfShards() == 1 ? QueryFetchSearchResult::new : QuerySearchResult::new);
361361

362-
transportService.registerRequestHandler(QUERY_ID_ACTION_NAME, QuerySearchRequest::new, ThreadPool.Names.SEARCH,
362+
transportService.registerRequestHandler(QUERY_ID_ACTION_NAME, QuerySearchRequest::new, ThreadPool.Names.SAME,
363363
new TaskAwareTransportRequestHandler<QuerySearchRequest>() {
364364
@Override
365365
public void messageReceived(QuerySearchRequest request, TransportChannel channel, Task task) {
@@ -369,7 +369,7 @@ public void messageReceived(QuerySearchRequest request, TransportChannel channel
369369
});
370370
TransportActionProxy.registerProxyAction(transportService, QUERY_ID_ACTION_NAME, QuerySearchResult::new);
371371

372-
transportService.registerRequestHandler(QUERY_SCROLL_ACTION_NAME, InternalScrollSearchRequest::new, ThreadPool.Names.SEARCH,
372+
transportService.registerRequestHandler(QUERY_SCROLL_ACTION_NAME, InternalScrollSearchRequest::new, ThreadPool.Names.SAME,
373373
new TaskAwareTransportRequestHandler<InternalScrollSearchRequest>() {
374374
@Override
375375
public void messageReceived(InternalScrollSearchRequest request, TransportChannel channel, Task task) {
@@ -379,7 +379,7 @@ public void messageReceived(InternalScrollSearchRequest request, TransportChanne
379379
});
380380
TransportActionProxy.registerProxyAction(transportService, QUERY_SCROLL_ACTION_NAME, ScrollQuerySearchResult::new);
381381

382-
transportService.registerRequestHandler(QUERY_FETCH_SCROLL_ACTION_NAME, InternalScrollSearchRequest::new, ThreadPool.Names.SEARCH,
382+
transportService.registerRequestHandler(QUERY_FETCH_SCROLL_ACTION_NAME, InternalScrollSearchRequest::new, ThreadPool.Names.SAME,
383383
new TaskAwareTransportRequestHandler<InternalScrollSearchRequest>() {
384384
@Override
385385
public void messageReceived(InternalScrollSearchRequest request, TransportChannel channel, Task task) {
@@ -389,7 +389,7 @@ public void messageReceived(InternalScrollSearchRequest request, TransportChanne
389389
});
390390
TransportActionProxy.registerProxyAction(transportService, QUERY_FETCH_SCROLL_ACTION_NAME, ScrollQueryFetchSearchResult::new);
391391

392-
transportService.registerRequestHandler(FETCH_ID_SCROLL_ACTION_NAME, ShardFetchRequest::new, ThreadPool.Names.SEARCH,
392+
transportService.registerRequestHandler(FETCH_ID_SCROLL_ACTION_NAME, ShardFetchRequest::new, ThreadPool.Names.SAME,
393393
new TaskAwareTransportRequestHandler<ShardFetchRequest>() {
394394
@Override
395395
public void messageReceived(ShardFetchRequest request, TransportChannel channel, Task task){
@@ -399,7 +399,7 @@ public void messageReceived(ShardFetchRequest request, TransportChannel channel,
399399
});
400400
TransportActionProxy.registerProxyAction(transportService, FETCH_ID_SCROLL_ACTION_NAME, FetchSearchResult::new);
401401

402-
transportService.registerRequestHandler(FETCH_ID_ACTION_NAME, ShardFetchSearchRequest::new, ThreadPool.Names.SEARCH, true, true,
402+
transportService.registerRequestHandler(FETCH_ID_ACTION_NAME, ShardFetchSearchRequest::new, ThreadPool.Names.SAME, true, true,
403403
new TaskAwareTransportRequestHandler<ShardFetchSearchRequest>() {
404404
@Override
405405
public void messageReceived(ShardFetchSearchRequest request, TransportChannel channel, Task task) {

0 commit comments

Comments
 (0)