This is an automated email from the ASF dual-hosted git repository.

dsmiley pushed a commit to branch branch_10x
in repository https://gitbox.apache.org/repos/asf/solr.git

commit 8664b1fff98203f96cfadea976410fcf7ee0ab7b
Author: David Smiley <[email protected]>
AuthorDate: Sun Aug 16 12:32:05 2026 -0400

    HttpJettySolrClient: use fewer threads (#4668)
    
    HttpJettySolrClient defaults would often create 32 threads, likely 
under-utilizing them. and it would cap threads to 256.  Now it does neither by 
default but Executor customization (and other saturation controls) remain.
    
    (cherry picked from commit 53800021a90b1fd1c147147a0307d458dea25ee1)
---
 changelog/unreleased/PR#4668-JettyClientFewerThreads.yml         | 9 +++++++++
 .../org/apache/solr/client/solrj/jetty/HttpJettySolrClient.java  | 6 +-----
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/changelog/unreleased/PR#4668-JettyClientFewerThreads.yml 
b/changelog/unreleased/PR#4668-JettyClientFewerThreads.yml
new file mode 100644
index 00000000000..826c5f464ac
--- /dev/null
+++ b/changelog/unreleased/PR#4668-JettyClientFewerThreads.yml
@@ -0,0 +1,9 @@
+title: >
+  HttpJettySolrClient defaults would often create 32 threads, likely 
under-utilizing them. and it would cap threads to 256.
+  Now it does neither by default but Executor customization (and other 
saturation controls) remain.
+type: changed
+authors:
+  - name: David Smiley
+links:
+  - name: PR#4668
+    url: https://github.com/apache/solr/pull/4668
diff --git 
a/solr/solrj-jetty/src/java/org/apache/solr/client/solrj/jetty/HttpJettySolrClient.java
 
b/solr/solrj-jetty/src/java/org/apache/solr/client/solrj/jetty/HttpJettySolrClient.java
index fbc276cc992..e561dc4d056 100644
--- 
a/solr/solrj-jetty/src/java/org/apache/solr/client/solrj/jetty/HttpJettySolrClient.java
+++ 
b/solr/solrj-jetty/src/java/org/apache/solr/client/solrj/jetty/HttpJettySolrClient.java
@@ -83,7 +83,6 @@ import org.eclipse.jetty.http.MultiPart;
 import org.eclipse.jetty.http2.client.HTTP2Client;
 import org.eclipse.jetty.http2.client.transport.HttpClientTransportOverHTTP2;
 import org.eclipse.jetty.io.ClientConnector;
-import org.eclipse.jetty.util.BlockingArrayQueue;
 import org.eclipse.jetty.util.ssl.KeyStoreScanner;
 import org.eclipse.jetty.util.ssl.SslContextFactory;
 import org.slf4j.Logger;
@@ -220,10 +219,7 @@ public class HttpJettySolrClient extends HttpSolrClient {
   private HttpClient createHttpClient(Builder builder) {
     executor = builder.getExecutor();
     if (executor == null) {
-      BlockingArrayQueue<Runnable> queue = new BlockingArrayQueue<>(256, 256);
-      this.executor =
-          new ExecutorUtil.MDCAwareThreadPoolExecutor(
-              32, 256, 60, TimeUnit.SECONDS, queue, new 
SolrNamedThreadFactory("h2sc"));
+      this.executor = ExecutorUtil.newMDCAwareCachedThreadPool(new 
SolrNamedThreadFactory("h2sc"));
       shutdownExecutor = true;
     } else {
       shutdownExecutor = false;

Reply via email to