sigram commented on code in PR #3155:
URL: https://github.com/apache/solr/pull/3155#discussion_r1939248091
##########
solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java:
##########
@@ -228,25 +229,15 @@ public static ExecutorService
initCollectorExecutor(NodeConfig cfg) {
return null;
}
+ // note that Lucene will catch a RejectedExecutionException to just run
the task.
+ // Therefore, we shouldn't worry too much about the queue size.
return new MDCAwareThreadPoolExecutor(
indexSearcherExecutorThreads,
indexSearcherExecutorThreads,
0L,
TimeUnit.MILLISECONDS,
- new SynchronousQueue<>(true) { // fairness
- // a hack to force ThreadPoolExecutor to block if threads are busy
- // -- otherwise it will throw RejectedExecutionException;
unacceptable
- @Override
- public boolean offer(Runnable runnable) { // is supposed to not
block, but we do anyway
- try {
- put(runnable); // blocks
- } catch (InterruptedException e) {
- Thread.currentThread().interrupt();
- throw new RuntimeException("interrupted submitting to search
multi-threaded pool", e);
- }
- return true;
- }
- },
+ new LinkedBlockingQueue<>(
+ EnvUtils.getPropertyAsInteger("solr.searcherCollector.queueSize",
1000)),
Review Comment:
Needs docs?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]