adityamparikh opened a new pull request, #130: URL: https://github.com/apache/solr-mcp/pull/130
## Summary The JDK 25 `HttpClient`'s HTTP/2 transport intermittently closes reused connections with `java.io.EOFException` against Solr/Jetty, causing test flakiness on CI runners. Recently observed in: - `SearchServiceIntegrationTest.testSpecialCharactersInQuery` (older report) - `SearchServiceIntegrationTest.testCombinedSortingAndFiltering` (today, native CI run) - `IndexingServiceIntegrationTest.testIndexJsonDocumentsWithNestedObjects` (today, second attempt) Each run picks a different victim test — the common thread is `Caused by: java.io.EOFException at Http2Connection.java:1903`. HTTP/2 multiplexing is not needed for our usage (a single MCP server talking to Solr); force HTTP/1.1 on `HttpJdkSolrClient` via `useHttp1_1(true)` for deterministic behavior. ## Diff One-line change: add `.useHttp1_1(true)` to the `HttpJdkSolrClient.Builder` chain in `SolrConfig.solrClient()`. Plus a comment explaining why. ```diff - return new HttpJdkSolrClient.Builder(url).withConnectionTimeout(CONNECTION_TIMEOUT_MS, TimeUnit.MILLISECONDS) - .withIdleTimeout(SOCKET_TIMEOUT_MS, TimeUnit.MILLISECONDS).withResponseParser(jsonResponseParser) - .withRequestWriter(new XMLRequestWriter()).build(); + return new HttpJdkSolrClient.Builder(url).withConnectionTimeout(CONNECTION_TIMEOUT_MS, TimeUnit.MILLISECONDS) + .withIdleTimeout(SOCKET_TIMEOUT_MS, TimeUnit.MILLISECONDS).useHttp1_1(true) + .withResponseParser(jsonResponseParser).withRequestWriter(new XMLRequestWriter()).build(); ``` ## Background This fix was authored locally as part of the `fix/solrj-force-http1` branch back in May 2026 but never landed upstream. It's been carried in derivative branches and rediscovered today when the same flake bit a different test in CI for ongoing native-image work. ## Test plan - [ ] CI green (no transient `EOFException` from `Http2Connection.java`) - [ ] No functional regression: SolrJ continues to talk to Solr via HTTP/1.1, which is fully supported by Solr/Jetty 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
