mirror of https://github.com/apache/lucene.git
SOLR-7064: ConcurrentUpdateSolrClient should only close it's httpclient if it created it.
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1724288 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7c6dc54ef5
commit
d25c982e0d
|
@ -86,6 +86,7 @@ public class ConcurrentUpdateSolrClient extends SolrClient {
|
|||
boolean shutdownExecutor = false;
|
||||
int pollQueueTime = 250;
|
||||
private final boolean streamDeletes;
|
||||
private boolean internalHttpClient;
|
||||
|
||||
/**
|
||||
* Uses an internally managed HttpClient instance.
|
||||
|
@ -101,6 +102,7 @@ public class ConcurrentUpdateSolrClient extends SolrClient {
|
|||
int threadCount) {
|
||||
this(solrServerUrl, null, queueSize, threadCount);
|
||||
shutdownExecutor = true;
|
||||
internalHttpClient = true;
|
||||
}
|
||||
|
||||
public ConcurrentUpdateSolrClient(String solrServerUrl,
|
||||
|
@ -471,7 +473,7 @@ public class ConcurrentUpdateSolrClient extends SolrClient {
|
|||
|
||||
@Override
|
||||
public void close() {
|
||||
IOUtils.closeQuietly(client);
|
||||
if (internalHttpClient) IOUtils.closeQuietly(client);
|
||||
if (shutdownExecutor) {
|
||||
scheduler.shutdown();
|
||||
try {
|
||||
|
@ -500,7 +502,7 @@ public class ConcurrentUpdateSolrClient extends SolrClient {
|
|||
}
|
||||
|
||||
public void shutdownNow() {
|
||||
IOUtils.closeQuietly(client);
|
||||
if (internalHttpClient) IOUtils.closeQuietly(client);
|
||||
if (shutdownExecutor) {
|
||||
scheduler.shutdownNow(); // Cancel currently executing tasks
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue