@@ -364,6 +364,7 @@ public void analyzedPlan(
364364 QueryBuilder requestFilter ,
365365 ActionListener <LogicalPlan > logicalPlanListener
366366 ) {
367+ assert ThreadPool .assertCurrentThreadPool (ThreadPool .Names .SEARCH );
367368 if (parsed .analyzed ()) {
368369 logicalPlanListener .onResponse (parsed );
369370 return ;
@@ -440,6 +441,11 @@ private void preAnalyzeLookupIndex(
440441 String localPattern = lookupIndexPattern .indexPattern ();
441442 assert RemoteClusterAware .isRemoteIndexName (localPattern ) == false
442443 : "Lookup index name should not include remote, but got: " + localPattern ;
444+ assert ThreadPool .assertCurrentThreadPool (
445+ ThreadPool .Names .SEARCH ,
446+ ThreadPool .Names .SEARCH_COORDINATION ,
447+ ThreadPool .Names .SYSTEM_READ
448+ );
443449 Set <String > fieldNames = result .wildcardJoinIndices ().contains (localPattern ) ? IndexResolver .ALL_FIELDS : result .fieldNames ;
444450
445451 String patternWithRemotes ;
@@ -625,6 +631,11 @@ private void preAnalyzeMainIndices(
625631 QueryBuilder requestFilter ,
626632 ActionListener <PreAnalysisResult > listener
627633 ) {
634+ assert ThreadPool .assertCurrentThreadPool (
635+ ThreadPool .Names .SEARCH ,
636+ ThreadPool .Names .SEARCH_COORDINATION ,
637+ ThreadPool .Names .SYSTEM_READ
638+ );
628639 // TODO we plan to support joins in the future when possible, but for now we'll just fail early if we see one
629640 List <IndexPattern > indices = preAnalysis .indices ;
630641 if (indices .size () > 1 ) {
0 commit comments