diff --git a/solr/core/src/java/org/apache/solr/core/CoreContainer.java b/solr/core/src/java/org/apache/solr/core/CoreContainer.java index f14680d5561..f443e68d828 100644 --- a/solr/core/src/java/org/apache/solr/core/CoreContainer.java +++ b/solr/core/src/java/org/apache/solr/core/CoreContainer.java @@ -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"})