[
https://issues.apache.org/jira/browse/SOLR-11104?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Shalin Shekhar Mangar updated SOLR-11104:
-----------------------------------------
Description:
LbHttpSolrClient has the following constructor. This is also used by the
builder.
{code}
/**
* 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();
}
{code}
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.
was:
LbHttpSolrClient has the following constructor. This is also used by the
builder.
{code}
/**
* 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();
}
{code}
The given HttpClient is always ignored. This also means that when using this
constructor, the the HttpClient created here is never closed.
> LbHttpSolrClient ignores given HttpClient in constructor on 6.x
> ---------------------------------------------------------------
>
> Key: SOLR-11104
> URL: https://issues.apache.org/jira/browse/SOLR-11104
> Project: Solr
> Issue Type: Bug
> Security Level: Public(Default Security Level. Issues are Public)
> Components: clients - java
> Affects Versions: 6.0.1, 6.1, 6.2, 6.3, 6.4, 6.5, 6.5.1, 6.6
> Reporter: Shalin Shekhar Mangar
> Assignee: Shalin Shekhar Mangar
> Fix For: 6.7
>
> Attachments: SOLR-11104.patch
>
>
> LbHttpSolrClient has the following constructor. This is also used by the
> builder.
> {code}
> /**
> * 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();
> }
> {code}
> 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.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]