Skip to content
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

Use direct executor for DrillSideways tasks #651

Merged
merged 2 commits into from
Apr 22, 2024

Conversation

aprudhomme
Copy link
Contributor

DrillSideways takes an ExecutorService, which it used to enqueue drill down sub tasks during search. We are currently passing the search thread pool.

Since both DrillSideways and parallel search use the same thread pool, there is an execution dependency that can lead to deadlock. This can happen when a burst of requests fill the search thread pool will just DrillSideways task, preventing spawned search tasks from running.

This branch uses a direct executor to run the DrillSideways tasks in the calling thread (grpc thread). Since we never add any additional drill downs to the query, there will be only one DrillSideways task.

@aprudhomme aprudhomme requested a review from sarthakn7 April 22, 2024 22:54
@@ -148,7 +147,7 @@ public SearchResponse handle(IndexState indexState, SearchRequest searchRequest)
shardState,
searchContext.getQueryFields(),
grpcFacetResults,
threadPoolExecutor,
DIRECT_EXECUTOR,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add some comments here so that it's clear why we are using the direct executor?

@aprudhomme aprudhomme requested a review from sarthakn7 April 22, 2024 23:10
@aprudhomme aprudhomme merged commit 8423e65 into Yelp:master Apr 22, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants