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-4614) ClusterState#getSlices returns null causing NPE in ClientUtils#addSlices
Date Tue, 19 Mar 2013 16:35:16 GMT

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

Mark Miller commented on SOLR-4614:
-----------------------------------

Perhaps a NullPointer is right? Or illegal argument exception? I have not looked into what
that affects, but I think I hit this same thing and went with a fix higher up of:

{code}
        if (colSlices == null) {
          throw new SolrServerException("Could not find collection:" + collectionName);
        }
{code}

I guess it depends on what adding slices to a null slice means - my first thought was that
it was an error.
                
> ClusterState#getSlices returns null causing NPE in ClientUtils#addSlices
> ------------------------------------------------------------------------
>
>                 Key: SOLR-4614
>                 URL: https://issues.apache.org/jira/browse/SOLR-4614
>             Project: Solr
>          Issue Type: Bug
>          Components: clients - java, SolrCloud
>    Affects Versions: 4.1
>            Reporter: David Arthur
>            Priority: Minor
>
> When my program sends an UpdateRequest to a collection that has been deleted, I am getting
a NPE
> {code}
> java.lang.NullPointerException
>     at org.apache.solr.client.solrj.util.ClientUtils.addSlices(ClientUtils.java:273)
>     at org.apache.solr.client.solrj.impl.CloudSolrServer.request(CloudSolrServer.java:214)
>     at org.apache.solr.client.solrj.request.AbstractUpdateRequest.process(AbstractUpdateRequest.java:117)
> {code}
> This appears to be caused by the fact that ClusterState#getSlices is returning null instead
of an empty collection.
> ClusterState returning null: https://github.com/apache/lucene-solr/blob/lucene_solr_4_1/solr/solrj/src/java/org/apache/solr/common/cloud/ClusterState.java#L123
> ClientUtil#addSlices iterating over a null: https://github.com/apache/lucene-solr/blob/lucene_solr_4_1/solr/solrj/src/java/org/apache/solr/client/solrj/util/ClientUtils.java#L273
> I would attach a patch, but I'm not sure what the preferred style is within the project
(empty collection vs null checks).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


Mime
View raw message