Skip to content

Commit a8606de

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 d5b2c9e commit a8606de

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
@@ -358,7 +358,7 @@ public void messageReceived(ShardSearchTransportRequest request, TransportChanne
358358
TransportActionProxy.registerProxyActionWithDynamicResponseType(transportService, QUERY_ACTION_NAME,
359359
(request) -> ((ShardSearchRequest)request).numberOfShards() == 1 ? QueryFetchSearchResult::new : QuerySearchResult::new);
360360

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

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

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

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

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

0 commit comments

Comments
 (0)