mirror of https://github.com/apache/lucene.git
SOLR-13887: Use the default idleTimeout instead of 0 for HTTP2 (#991)
This commit is contained in:
parent
c5d0391df9
commit
80ed8c281b
|
@ -268,6 +268,8 @@ Bug Fixes
|
|||
* SOLR-14219: SOLR-14095 Introduced an issue for rolling restarts (Incompatible Java serialization). This change
|
||||
Fixes the compatibility issue while keeping the functionality in SOLR-14095. (Andy Webb, Tomás Fernández Löbbe)
|
||||
|
||||
* SOLR-13887: Use default idleTimeout instead of 0 for HTTP2 requests. (Houston Putman)
|
||||
|
||||
Other Changes
|
||||
---------------------
|
||||
|
||||
|
|
|
@ -40,8 +40,8 @@ You can find `solr.xml` in your `$SOLR_HOME` directory (usually `server/solr`) i
|
|||
|
||||
<shardHandlerFactory name="shardHandlerFactory"
|
||||
class="HttpShardHandlerFactory">
|
||||
<int name="socketTimeout">${socketTimeout:0}</int>
|
||||
<int name="connTimeout">${connTimeout:0}</int>
|
||||
<int name="socketTimeout">${socketTimeout:600000}</int>
|
||||
<int name="connTimeout">${connTimeout:600000}</int>
|
||||
</shardHandlerFactory>
|
||||
|
||||
</solr>
|
||||
|
@ -232,15 +232,15 @@ Solr supports variable substitution of JVM system property values in `solr.xml`,
|
|||
|
||||
Any JVM system properties usually specified using the `-D` flag when starting the JVM, can be used as variables in the `solr.xml` file.
|
||||
|
||||
For example, in the `solr.xml` file shown below, the `socketTimeout` and `connTimeout` values are each set to "0". However, if you start Solr using `bin/solr -DsocketTimeout=1000`, the `socketTimeout` option of the `HttpShardHandlerFactory` to be overridden using a value of 1000ms, while the `connTimeout` option will continue to use the default property value of "0".
|
||||
For example, in the `solr.xml` file shown below, the `socketTimeout` and `connTimeout` values are each set to "60000". However, if you start Solr using `bin/solr -DsocketTimeout=1000`, the `socketTimeout` option of the `HttpShardHandlerFactory` to be overridden using a value of 1000ms, while the `connTimeout` option will continue to use the default property value of "60000".
|
||||
|
||||
[source,xml]
|
||||
----
|
||||
<solr>
|
||||
<shardHandlerFactory name="shardHandlerFactory"
|
||||
class="HttpShardHandlerFactory">
|
||||
<int name="socketTimeout">${socketTimeout:0}</int>
|
||||
<int name="connTimeout">${connTimeout:0}</int>
|
||||
<int name="socketTimeout">${socketTimeout:60000}</int>
|
||||
<int name="connTimeout">${connTimeout:60000}</int>
|
||||
</shardHandlerFactory>
|
||||
</solr>
|
||||
----
|
||||
|
|
|
@ -146,7 +146,7 @@ public class Http2SolrClient extends SolrClient {
|
|||
this.serverBaseUrl = serverBaseUrl;
|
||||
}
|
||||
|
||||
if (builder.idleTimeout != null) idleTimeout = builder.idleTimeout;
|
||||
if (builder.idleTimeout != null && builder.idleTimeout > 0) idleTimeout = builder.idleTimeout;
|
||||
else idleTimeout = HttpClientUtil.DEFAULT_SO_TIMEOUT;
|
||||
|
||||
if (builder.http2SolrClient == null) {
|
||||
|
@ -215,7 +215,7 @@ public class Http2SolrClient extends SolrClient {
|
|||
httpClient.setMaxRequestsQueuedPerDestination(asyncTracker.getMaxRequestsQueuedPerDestination());
|
||||
httpClient.setUserAgentField(new HttpField(HttpHeader.USER_AGENT, AGENT));
|
||||
|
||||
if (builder.idleTimeout != null) httpClient.setIdleTimeout(builder.idleTimeout);
|
||||
httpClient.setIdleTimeout(idleTimeout);
|
||||
if (builder.connectionTimeout != null) httpClient.setConnectTimeout(builder.connectionTimeout);
|
||||
try {
|
||||
httpClient.start();
|
||||
|
|
|
@ -183,6 +183,17 @@ public class Http2SolrClientTest extends SolrJettyTestBase {
|
|||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test0IdleTimeout() throws Exception {
|
||||
SolrQuery q = new SolrQuery("*:*");
|
||||
try(Http2SolrClient client = getHttp2SolrClient(jetty.getBaseUrl().toString() + "/debug/foo", DEFAULT_CONNECTION_TIMEOUT, 0)) {
|
||||
try {
|
||||
client.query(q, SolrRequest.METHOD.GET);
|
||||
} catch (ParseException ignored) {}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* test that SolrExceptions thrown by HttpSolrClient can
|
||||
* correctly encapsulate http status codes even when not on the list of
|
||||
|
|
Loading…
Reference in New Issue