You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2020/10/14 17:14:49 UTC

[lucene-solr] branch reference_impl_dev updated: @996 Set idle on requests so it takes affect when sharing internal http client across solr clients. Raise response size buffer (should prob look at changing that to stream like asyncRequest)

This is an automated email from the ASF dual-hosted git repository.

markrmiller pushed a commit to branch reference_impl_dev
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/reference_impl_dev by this push:
     new 15249c0  @996 Set idle on requests so it takes affect when sharing internal http client across solr clients. Raise response size buffer (should prob look at changing that to stream like asyncRequest)
15249c0 is described below

commit 15249c0b4d424ddc5ea857402bdc44781610e6ec
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Wed Oct 14 12:14:18 2020 -0500

    @996 Set idle on requests so it takes affect when sharing internal http client across solr clients. Raise response size buffer (should prob look at changing that to stream like asyncRequest)
---
 .../java/org/apache/solr/client/solrj/impl/Http2SolrClient.java    | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java
index 8de1b7b..a8d8d7b 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java
@@ -233,7 +233,6 @@ public class Http2SolrClient extends SolrClient {
       log.debug("Create Http2SolrClient with HTTP/2 transport");
       HTTP2Client http2client = new HTTP2Client();
       http2client.setSelectors(2);
-      http2client.setIdleTimeout(idleTimeout);
       http2client.setMaxConcurrentPushedStreams(512);
       http2client.setInputBufferSize(8192);
       HttpClientTransportOverHTTP2 transport = new HttpClientTransportOverHTTP2(http2client);
@@ -368,6 +367,7 @@ public class Http2SolrClient extends SolrClient {
         .method(HttpMethod.POST)
         .header(HttpHeader.CONTENT_TYPE, contentType)
         .content(provider);
+    postRequest.idleTimeout(idleTimeout, TimeUnit.MILLISECONDS);
     for (Map.Entry<String,String> entry : headers.entrySet()) {
       postRequest.header(entry.getKey(), entry.getValue());
     }
@@ -621,6 +621,7 @@ public class Http2SolrClient extends SolrClient {
       for (Map.Entry<String,String> entry : headers.entrySet()) {
         req.header(entry.getKey(), entry.getValue());
       }
+      req.idleTimeout(idleTimeout, TimeUnit.MILLISECONDS);
       return req;
     }
 
@@ -629,6 +630,7 @@ public class Http2SolrClient extends SolrClient {
       for (Map.Entry<String,String> entry : headers.entrySet()) {
         req.header(entry.getKey(), entry.getValue());
       }
+      req.idleTimeout(idleTimeout, TimeUnit.MILLISECONDS);
       return req;
     }
 
@@ -654,7 +656,8 @@ public class Http2SolrClient extends SolrClient {
         for (Map.Entry<String,String> entry : headers.entrySet()) {
           req.header(entry.getKey(), entry.getValue());
         }
-        ByteArrayOutputStream baos = new ByteArrayOutputStream(4096);
+        req.idleTimeout(idleTimeout, TimeUnit.MILLISECONDS);
+        ByteArrayOutputStream baos = new ByteArrayOutputStream(8192);
         contentWriter.write(baos);
 
         //TODO reduce memory usage