tpunder commented on code in PR #1861:
URL: https://github.com/apache/solr/pull/1861#discussion_r1302281953


##########
solr/core/src/java/org/apache/solr/core/QuerySenderListener.java:
##########
@@ -44,65 +53,131 @@ public QuerySenderListener(SolrCore core) {
 
   @Override
   public void newSearcher(SolrIndexSearcher newSearcher, SolrIndexSearcher 
currentSearcher) {
+    final long startTimeNanos = System.nanoTime();
+
     final SolrIndexSearcher searcher = newSearcher;
     log.debug("QuerySenderListener sending requests to {}", newSearcher);
     @SuppressWarnings("unchecked")
     List<NamedList<Object>> allLists =
         convertQueriesToList((ArrayList<Object>) getArgs().getAll("queries"));
     if (allLists == null) return;
-    for (NamedList<Object> nlst : allLists) {
+    final int threads = getThreadsParam();
+
+    if (0 == threads || 1 == threads || allLists.isEmpty()) { // Non-threaded 
code path
+      for (NamedList<Object> nlst : allLists) {
+        runQuery(newSearcher, currentSearcher, nlst);
+      }
+    } else { // Multi-threaded code path
+      final int nThreads = threads > 0 ? threads : 
Runtime.getRuntime().availableProcessors();

Review Comment:
   I'll add documentation to the Solr Guide for this behavior.



-- 
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: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to