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

4.10.3 SolrJ is throwing a SERVER_ERROR exception instead of BAD_REQUEST

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 4.10.3
    • 5.2, 6.0
    • None
    • None

    Description

      We found this problem while upgrading Solr from 4.4 to 4.10.3. Our integration test is similar to this Solr unit test,

      https://github.com/apache/lucene-solr/blob/trunk/solr/core/src/test/org/apache/solr/schema/TestCloudSchemaless.java

      Specifically we test if the Solr server returns BAD_REQUEST when provided with incorrect input.The only difference is that it uses CloudSolrServer instead of HttpSolrServer. The CloudSolrServer always returns SERVER_ERROR error code. Please take a look

      https://github.com/apache/lucene-solr/blob/817303840fce547a1557e330e93e5a8ac0618f34/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrServer.java#L359

      I think we can improve the error handling by checking if the first exception in the list is of type SolrException and if that is the case return the error code associated with that exception. If the first exception is not of type SolrException, then we can return SERVER_ERROR code.

      Attachments

        1. SOLR-7243.patch
          1 kB
          Hrishikesh Gadre
        2. SOLR-7243.patch
          1 kB
          Hrishikesh Gadre
        3. SOLR-7243.patch
          3 kB
          Hrishikesh Gadre
        4. SOLR-7243.patch
          3 kB
          Hrishikesh Gadre
        5. SOLR-7243.patch
          4 kB
          Shawn Heisey

        Activity

          People

            elyograg Shawn Heisey
            hgadre Hrishikesh Gadre
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: