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

LBHttpSolrClient.request can return incorrect Rsp.server string

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.2, 7.0
    • Component/s: None
    • Security Level: Public (Default Security Level. Issues are Public)
    • Labels:
      None

      Description

      Problem:

      • LBHttpSolrClient.request assigns to rsp.server at line 361 and then at line 366 makes a doRequest(client, req, rsp, isUpdate, false, null); method call.
      • If the original doRequest call(s) did not succeed then later at line 382 additional doRequest calls may happen. These calls could use a different server but currently rsp.server remains unchanged and thus LBHttpSolrClient.request could return an incorrect Rsp.server string value.

      Proposed fix:

      • Change the doRequest method so that it assigns Rsp.server alongside the existing Rsp.rsp assignment.
      • Note that since the HttpSolrClient constructor trims of any trailing / from the baseUrl then the proposed fix potentially minutely changes the Rsp.getServer() return value.
        • Rsp.getServer() is called by HttpShardHandler.submit as srsp.setShardAddress(rsp.getServer());
        • I have not fully checked where/how getShardAddress() is then subsequently used but would very much hope that the removal of a trailing / would not cause any issues.

        Attachments

        1. SOLR-9391.patch
          4 kB
          Christine Poerschke

          Activity

            People

            • Assignee:
              cpoerschke Christine Poerschke
              Reporter:
              cpoerschke Christine Poerschke
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: