Skip to content

Commit

Permalink
SOLR-13350: multi-threaded search: (undocumented) opt-out ability (#2570
Browse files Browse the repository at this point in the history
)

On a request level, multiThreaded=false is already possible but for full (node level) opt-out SolrIndexSearcher must pass a null executor to Lucene's IndexSearcher.
  • Loading branch information
cpoerschke authored Jul 23, 2024
1 parent 31129e4 commit 06950c6
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions solr/core/src/java/org/apache/solr/core/CoreContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -442,11 +442,16 @@ public CoreContainer(NodeConfig config, CoresLocator locator, boolean asyncSolrC

this.allowListUrlChecker = AllowListUrlChecker.create(config);

this.collectorExecutor =
ExecutorUtil.newMDCAwareCachedThreadPool(
cfg.getIndexSearcherExecutorThreads(), // thread count
cfg.getIndexSearcherExecutorThreads() * 1000, // queue size
new SolrNamedThreadFactory("searcherCollector"));
final int indexSearcherExecutorThreads = cfg.getIndexSearcherExecutorThreads();
if (0 < indexSearcherExecutorThreads) {
this.collectorExecutor =
ExecutorUtil.newMDCAwareCachedThreadPool(
indexSearcherExecutorThreads, // thread count
indexSearcherExecutorThreads * 1000, // queue size
new SolrNamedThreadFactory("searcherCollector"));
} else {
this.collectorExecutor = null;
}
}

@SuppressWarnings({"unchecked"})
Expand Down

0 comments on commit 06950c6

Please sign in to comment.