lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Miller (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SOLR-8451) We should not call method.abort in HttpSolrClient and HttpSolrCall#remoteQuery should not close streams.
Date Fri, 22 Jan 2016 02:29:39 GMT

    [ https://issues.apache.org/jira/browse/SOLR-8451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15111807#comment-15111807
] 

Mark Miller commented on SOLR-8451:
-----------------------------------

bq. HttpClient appears to clean up these situations for us.

I have not been able to find it in the code. Perhaps it's java itself actually:
{noformat}
Prior to JDK 6, if an application closes a HTTP InputStream when more than a small amount
of data remains to be read, then the connection had to be closed, rather than being cached.
Now in JDK 6, the behavior is to read up to 512 Kbytes off the connection in a background
thread, thus allowing the connection to be reused. The exact amount of data which may be read
is configurable through the http.KeepAlive.remainingData system property.
{noformat}

All the more reason to do it right our self if so.

It may be the case that simply closing the inputstream is all we need to do:

bq.  if the response body is long and you are not interested in the rest of it after seeing
the beginning, you can close the InputStream. 

But, that may usually work, but not always:

bq. But you need to be aware that more data could be on its way. Thus the connection may not
be cleared for reuse.

So I see great connection reuse in tests, but this is all hairy stuff. We need to consume
these streams just to be sure we are hitting every case.

> We should not call method.abort in HttpSolrClient and HttpSolrCall#remoteQuery should
not close streams.
> --------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-8451
>                 URL: https://issues.apache.org/jira/browse/SOLR-8451
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Mark Miller
>            Assignee: Mark Miller
>         Attachments: SOLR-8451.patch, SOLR-8451.patch, SOLR-8451.patch, SOLR-8451.patch,
SOLR-8451.patch
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message