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

Roger Lehmann edited comment on SOLR-14457 at 5/6/20, 8:40 AM:
---------------------------------------------------------------

Sorry for the confusion!
 We're using the HTTP1 client, since I think Http2SolrClient doesn't yet have 
allowCompression() available?

The bug happens exactly as you say, I was just confused by the multiple wrapped 
objects and the content buffer seemingly being gzipped (see Debug view of the 
screenshots below). I'm not a Java programmer, just stumbled upon this issue 
when we tried use GZIP in our production environment and it ran against the 
wall. So I can't help much with further debugging/developing a fix for it 
unfortunately.

I've used using a small test application here with a prefilled Solr running in 
a Docker container for testing this.
 In our production environment we experience the same issue when using GZIP, 
not using Docker there.

!multiple-wrapped-entities.png!

!content-gzipped.png!


was (Author: roger.lehmann):
Sorry for the confusion!
We're using the HTTP1 client, since I think Http2SolrClient doesn't yet have 
allowCompression() available?

The bug happens exactly as you say, I was just confused by the multiple wrapped 
objects and the content buffer seemingly being gzipped (see Debug view of the 
screenshots below). I'm not a Java programmer, just stumbled upon this issue 
when we tried use GZIP in our production environment and it ran against the 
wall. So I can't help much with further debugging/developing a fix for it 
unfortunately.

I've used using a small test application here with a prefilled Solr running in 
a Docker container for testing this.
In our production environment we experience the same issue when using GZIP, not 
using Docker there.


{panel:title=Screenshots}
!multiple-wrapped-entities.png!

!content-gzipped.png! 
{panel}


> SolrClient leaks connections on compressed responses if the response is 
> malformed
> ---------------------------------------------------------------------------------
>
>                 Key: SOLR-14457
>                 URL: https://issues.apache.org/jira/browse/SOLR-14457
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: SolrJ
>    Affects Versions: 7.7.2
>         Environment: Solr version: 7.7.2
> Solr cloud enabled
> Cluster topology: 6 nodes, 1 single collection, 10 shards and 3 replicas. 1 
> HTTP LB using
> Round Robin over all nodes
> All cluster nodes have gzip enabled for all paths, all HTTP verbs and all 
> MIME types.
> Solr client: HttpSolrClient targeting the HTTP LB
>            Reporter: Samuel García Martínez
>            Priority: Major
>         Attachments: content-gzipped.png, multiple-wrapped-entities.png
>
>
> h3. Summary
> When the SolrJ receives a malformed response Entity, for example like the one 
> described in SOLR-14456, the client leaks the connection forever as it's 
> never released back to the pool.
> h3. Problem description
> HttpSolrClient should have compression enabled, so it uses the compression 
> interceptors.
> When the request is marked with "Content-Encoding: gzip" but for whatever 
> reason the response is not in GZIP format, when  HttpSolrClient tries to 
> close the connection using Utils.consumeFully(), it tries to create the 
> GzipInputStream failing and throwing an Exception. The exception thrown makes 
> it impossible to access the underlying InputStream to be closed, therefore 
> the connection is leaked.
> Despite that the content in the response should honour the headers specified 
> for it, SolrJ should be reliable enough to prevent the connection leak when 
> this scenario happens. On top of the bug itself, not being able to set a 
> timeout while waiting for a connection to be available, makes any application 
> unresponsive as it will run out of threads eventually.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to