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

epugh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr-mcp.git


The following commit(s) were added to refs/heads/main by this push:
     new 62e92cd  fix(solr): force HTTP/1.1 in SolrJ client to avoid flaky H2 
EOF (#130)
62e92cd is described below

commit 62e92cd8edac275675ceabb7459de1f4e68815ef
Author: Aditya Parikh <[email protected]>
AuthorDate: Fri May 8 16:34:36 2026 -0400

    fix(solr): force HTTP/1.1 in SolrJ client to avoid flaky H2 EOF (#130)
    
    The JDK 25 HttpClient's HTTP/2 transport intermittently closes
    reused connections with java.io.EOFException against Solr/Jetty,
    causing test flakiness (observed in
    SearchServiceIntegrationTest.testSpecialCharactersInQuery on CI).
    
    HTTP/2 multiplexing is not needed for our usage; force HTTP/1.1
    on HttpJdkSolrClient via useHttp1_1(true) for deterministic
    behavior.
    
    Signed-off-by: adityamparikh <[email protected]>
    Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
---
 src/main/java/org/apache/solr/mcp/server/config/SolrConfig.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/solr/mcp/server/config/SolrConfig.java 
b/src/main/java/org/apache/solr/mcp/server/config/SolrConfig.java
index b604783..7e7f983 100644
--- a/src/main/java/org/apache/solr/mcp/server/config/SolrConfig.java
+++ b/src/main/java/org/apache/solr/mcp/server/config/SolrConfig.java
@@ -193,8 +193,10 @@ public class SolrConfig {
                // JSON wire format for responses; XML wire format for update 
requests.
                // The default JavaBin request writer uses a binary codec that 
requires
                // additional reflection metadata in GraalVM native images.
+               // Force HTTP/1.1: the JDK HttpClient's HTTP/2 transport 
intermittently
+               // closes reused connections with an EOFException against 
Solr/Jetty.
                return new 
HttpJdkSolrClient.Builder(url).withConnectionTimeout(CONNECTION_TIMEOUT_MS, 
TimeUnit.MILLISECONDS)
-                               .withIdleTimeout(SOCKET_TIMEOUT_MS, 
TimeUnit.MILLISECONDS).withResponseParser(jsonResponseParser)
-                               .withRequestWriter(new 
XMLRequestWriter()).build();
+                               .withIdleTimeout(SOCKET_TIMEOUT_MS, 
TimeUnit.MILLISECONDS).useHttp1_1(true)
+                               
.withResponseParser(jsonResponseParser).withRequestWriter(new 
XMLRequestWriter()).build();
        }
 }

Reply via email to