lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shalin Shekhar Mangar (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SOLR-10698) StreamHandler should allow connections to be closed early
Date Wed, 31 May 2017 08:37:04 GMT

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

Shalin Shekhar Mangar commented on SOLR-10698:
----------------------------------------------

Just for some additional context -- The close method tries to consume the entire stream because
if you don't do that, the connection can no longer be re-used and must be discarded. So in
normal cases, this behavior of consuming the stream is a good thing because it allows you
the connection to go back to the pool and be reused. But obviously for long running requests
that receive huge amounts of data from StreamHandler or ExportHandler, attempting to consume
the stream fully on abort is a problem.

> StreamHandler should allow connections to be closed early 
> ----------------------------------------------------------
>
>                 Key: SOLR-10698
>                 URL: https://issues.apache.org/jira/browse/SOLR-10698
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Varun Thacker
>            Assignee: Erick Erickson
>             Fix For: master (7.0), 6.7
>
>         Attachments: SOLR-10698.patch
>
>
> Before a stream is drained out, if we call close() we get an exception like this:
> {code}
> at
> org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:215)
> at
> org.apache.http.impl.io.ChunkedInputStream.close(ChunkedInputStream.java:316)
> at
> org.apache.http.impl.execchain.ResponseEntityProxy.streamClosed(ResponseEntityProxy.java:128)
> at
> org.apache.http.conn.EofSensorInputStream.checkClose(EofSensorInputStream.java:228)
> at
> org.apache.http.conn.EofSensorInputStream.close(EofSensorInputStream.java:174)
> at sun.nio.cs.StreamDecoder.implClose(StreamDecoder.java:378)
> at sun.nio.cs.StreamDecoder.close(StreamDecoder.java:193)
> at java.io.InputStreamReader.close(InputStreamReader.java:199)
> at
> org.apache.solr.client.solrj.io.stream.JSONTupleStream.close(JSONTupleStream.java:91)
> at
> org.apache.solr.client.solrj.io.stream.SolrStream.close(SolrStream.java:186)
> {code}
> As quoted from https://www.mail-archive.com/solr-user@lucene.apache.org/msg130676.html
the problem seems to when we hit an exception the /steam handler does not close the stream.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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


Mime
View raw message