Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-7401

NPE when concurrently creating and deleting collections

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.2, 6.0
    • Component/s: SolrCloud
    • Labels:
      None

      Description

      I've hit this when multiple tests run against the same Solr server. Some tests create a collection, do some stuff and then delete it, but there are two tests which create+delete a collection, and then assert it doesn't exist by searching it (expecting to hit an exception). While I think this isn't the best way to assert a collection doesn't exist (I intend to change this assert to use a LIST command), it did surface this concurrency bug.

      java.lang.NullPointerException
      	at java.util.ArrayList.addAll(ArrayList.java:577)
      	at org.apache.solr.servlet.SolrDispatchFilter.getSlicesForCollections(SolrDispatchFilter.java:731)
      	at org.apache.solr.servlet.SolrDispatchFilter.getRemotCoreUrl(SolrDispatchFilter.java:669)
      

      The problem is that getSlicesForCollections may get a CollectionRef whose collection value may be null, therefore attempting to add null to the list. I reproduced in a test, and fixed the bug.

        Attachments

          Activity

            People

            • Assignee:
              shaie Shai Erera
              Reporter:
              shaie Shai Erera
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: