You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2015/12/04 16:12:11 UTC

[jira] [Commented] (SOLR-8366) ConcurrentUpdateSolrClient attempts to use response's content type as charset encoding

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

ASF subversion and git services commented on SOLR-8366:
-------------------------------------------------------

Commit 1717978 from shalin@apache.org in branch 'dev/trunk'
[ https://svn.apache.org/r1717978 ]

SOLR-8366: ConcurrentUpdateSolrClient attempts to use response's content type as charset encoding for parsing exception

> ConcurrentUpdateSolrClient attempts to use response's content type as charset encoding
> --------------------------------------------------------------------------------------
>
>                 Key: SOLR-8366
>                 URL: https://issues.apache.org/jira/browse/SOLR-8366
>             Project: Solr
>          Issue Type: Bug
>          Components: clients - java
>    Affects Versions: 5.3, 5.4
>            Reporter: Shalin Shekhar Mangar
>            Priority: Minor
>             Fix For: Trunk, 5.5
>
>         Attachments: SOLR-8336.patch
>
>
> While debugging the SolrExampleStreamingTest.testUpdateField failures on trunk, I noticed that ConcurrentUpdateSolrClient always logs the following when the server throws a conflict error:
> {code}
> WARN  (concurrentUpdateScheduler-2-thread-1-processing-http:////127.0.0.1:35848//solr//collection1) [    ] o.a.s.c.s.i.ConcurrentUpdateSolrClient Failed to parse error response from http://127.0.0.1:35848/solr/collection1 due to: org.apache.solr.common.SolrException: parsing error
> {code}
> The problem is the following code which uses the  response.getEntity().getContentType().getValue() as the charset encoding which is wrong because content type has mime type as well as charset.
> {code}
> try {
>               NamedList<Object> resp =
>                   client.parser.processResponse(response.getEntity().getContent(),
>                       response.getEntity().getContentType().getValue());
>               NamedList<Object> error = (NamedList<Object>) resp.get("error");
>               if (error != null)
>                 solrExc.setMetadata((NamedList<String>) error.get("metadata"));
>             } catch (Exception exc) {
>               // don't want to fail to report error if parsing the response fails
>               log.warn("Failed to parse error response from " + client.getBaseURL() + " due to: " + exc);
>             }
> {code}



--
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