> On 3 Sep 2023, at 17:30, Shawn Heisey <[email protected]> wrote:
>
> On 9/3/23 04:28, Ing. Andrea Vettori wrote:
>> what can cause this issue ?
>> This times out
>> solrServer = new Http2SolrClient.Builder(solrUrl)
>> .withRequestTimeout(SOLR_TIMEOUT_MINUTES,
>> TimeUnit.MINUTES)
>> .withConnectionTimeout(SOLR_TIMEOUT_MINUTES,
>> TimeUnit.MINUTES)
>> .withIdleTimeout(SOLR_TIMEOUT_MINUTES,
>> TimeUnit.MINUTES)
>> .build();
>
> What is the value of SOLR_TIMEOUT_MINUTES? This may not be super relevant,
> but I am curious.
For this test code I tried a few values of minutes to see if it would work
after some time (it never worked). Usually on production code we use different
timeouts all in the few seconds ranges.
>
> What is the Solr version on the server? Older Solr versions do not work well
> with http2. The workaround for those issues is to use http1.1.
It’s version 9.3.0 upgraded from 8.11.2
>
> If the server side is also 9.3.0, then http2 should work well, and I do not
> know what might be wrong. The exception with stacktrace might provide a clue.
Could it be related to the fact that url is http and not https ? Is http2
client able to use h2c and switch to http2 ? Using CURL I can connect to the
server without any issue (see below the log).
Here’s the exception
Exception in thread "main" org.apache.solr.client.solrj.SolrServerException:
Timeout occurred while waiting response from server at:
http://<localip>:8983/solr/up/admin/ping?wt=javabin&version=2
at
org.apache.solr.client.solrj.impl.Http2SolrClient.request(Http2SolrClient.java:522)
at
org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:234)
at org.apache.solr.client.solrj.SolrClient.ping(SolrClient.java:911)
at ecf3test.QuickTest.doWork(QuickTest.java:345)
at ecf3test.QuickTest.main(QuickTest.java:20)
Caused by: java.util.concurrent.TimeoutException
at
org.eclipse.jetty.client.util.InputStreamResponseListener.get(InputStreamResponseListener.java:214)
at
org.apache.solr.client.solrj.impl.Http2SolrClient.request(Http2SolrClient.java:512)
... 4 more
Here’s the curl trace
curl -v --http2 http://<localip>:8983/solr/up/admin/ping
* Trying <localip>:8983...
* Connected to <localip> (<localip>) port 8983 (#0)
> GET /solr/up/admin/ping HTTP/1.1
> Host: <localip>:8983
> User-Agent: curl/8.1.2
> Accept: */*
> Connection: Upgrade, HTTP2-Settings
> Upgrade: h2c
> HTTP2-Settings: AAMAAABkAAQAoAAAAAIAAAAA
>
< HTTP/1.1 101 Switching Protocols
< Upgrade: h2c
< Connection: Upgrade
* Received 101, Switching to HTTP/2
< HTTP/2 200
< content-security-policy: default-src 'none'; base-uri 'none'; connect-src
'self'; form-action 'self'; font-src 'self'; frame-ancestors 'none'; img-src
'self' data:; media-src 'self'; style-src 'self' 'unsafe-inline'; script-src
'self'; worker-src 'self';
< x-content-type-options: nosniff
< x-frame-options: SAMEORIGIN
< x-xss-protection: 1; mode=block
< content-type: application/json;charset=utf-8
< vary: Accept-Encoding
< content-length: 255
<
{
"responseHeader":{
"zkConnected":null,
"status":0,
"QTime":0,
"params":{
"q":"1",
"df":"key",
"distrib":"false",
"rows":"10",
"echoParams":"all",
"rid":"<localip>-138948"
}
},
"status":"OK"
* Connection #0 to host <localip> left intact
Thanks