Nick Shanin created SOLR-18628:
----------------------------------
Summary: HttpJdkSolrClient streamed update fails after idle h2c
connection expiry
Key: SOLR-18628
URL: https://issues.apache.org/jira/browse/SOLR-18628
Project: Solr
Issue Type: Bug
Reporter: Nick Shanin
Environment
- Solr/SolrJ 10.0.0
- Java 25
- Plain HTTP with h2c
Reproduction reported by a user
1. Create one HttpJdkSolrClient.
2. Add a document successfully.
3. Wait 35 seconds without client requests.
4. Add a second document with the same client.
The second update fails with `java.io.IOException: RST_STREAM received Protocol
error`. Server diagnostics reportedly show `RST_STREAM` followed by `GOAWAY`
with `invalid_preface`. The same sequence succeeds when HTTP/1.1 is forced or
the idle interval is reduced to 3 seconds.
Standalone reproducer: https://github.com/micopiira/solrj-h2c-idle-reproducer
Mailing-list report:
https://www.mail-archive.com/users%40solr.apache.org/msg09633.html
Candidate mechanism to verify (not yet confirmed): on current main,
`HttpJdkSolrClient.preparePutOrPost` calls `maybeTryHeadRequest` before
streaming a `RequestWriter.ContentWriter` body. A successful HEAD capability
probe is cached by base URI for the client lifetime. If the underlying
cleartext HTTP/2 connection expires while idle, a later streamed POST may need
to establish h2c again and may encounter the JDK client's
upgrade-with-streamed-body behavior that Jetty rejects.
Requested investigation
- Add a focused SolrJ regression test or adapt the standalone reproducer so
idle connection expiry is deterministic and the second update succeeds.
- Confirm the failure on the unmodified code and exercise the HTTP/1.1 and
short-idle controls.
- Test a narrow fix only after the fail-before case is established; preserve
HTTPS behavior and document any HTTP/2 or request-overhead tradeoff.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]