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

LbHttpSolrClient ignores given HttpClient in constructor on 6.x

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 6.0.1, 6.1, 6.2, 6.3, 6.4, 6.5, 6.5.1, 6.6
    • 6.7
    • clients - java
    • None

    Description

      LbHttpSolrClient has the following constructor. This is also used by the builder.

      /**
         * The provided httpClient should use a multi-threaded connection manager
         * @deprecated use {@link Builder} instead.  This will soon be a protected
         * method and will only be available for use in implementing subclasses.
         */
        public LBHttpSolrClient(HttpSolrClient.Builder httpSolrClientBuilder,
                                HttpClient httpClient, String... solrServerUrl) {
          clientIsInternal = httpClient == null;
          this.httpSolrClientBuilder = httpSolrClientBuilder;
          httpClient = constructClient(null);
          this.httpClient = httpClient;
          if (solrServerUrl != null) {
            for (String s : solrServerUrl) {
              ServerWrapper wrapper = new ServerWrapper(makeSolrClient(s));
              aliveServers.put(wrapper.getKey(), wrapper);
            }
          }
          updateAliveList();
        }
      

      The given HttpClient is always ignored. This also means that when using this constructor, the the HttpClient created here is never closed.

      The side effect is that the client passed to the CloudSolrClient via the builder is also ignored in favor of the internally created HttpClient.

      Attachments

        1. SOLR-11104.patch
          0.9 kB
          Shalin Shekhar Mangar

        Activity

          People

            shalin Shalin Shekhar Mangar
            shalin Shalin Shekhar Mangar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: