fix(solr): force HTTP/1.1 in SolrJ client to avoid flaky H2 EOF#130
Merged
Conversation
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. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: adityamparikh <aditya.m.parikh@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The JDK 25
HttpClient's HTTP/2 transport intermittently closes reused connections withjava.io.EOFExceptionagainst 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
HttpJdkSolrClientviauseHttp1_1(true)for deterministic behavior.Diff
One-line change: add
.useHttp1_1(true)to theHttpJdkSolrClient.Builderchain inSolrConfig.solrClient(). Plus a comment explaining why.Background
This fix was authored locally as part of the
fix/solrj-force-http1branch 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
EOFExceptionfromHttp2Connection.java)🤖 Generated with Claude Code