lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r1724288 - /lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java
Date Tue, 12 Jan 2016 17:17:47 GMT
Author: markrmiller
Date: Tue Jan 12 17:17:47 2016
New Revision: 1724288

URL: http://svn.apache.org/viewvc?rev=1724288&view=rev
Log:
SOLR-7064: ConcurrentUpdateSolrClient should only close it's httpclient if it created it.

Modified:
    lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java

Modified: lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java?rev=1724288&r1=1724287&r2=1724288&view=diff
==============================================================================
--- lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java
(original)
+++ lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java
Tue Jan 12 17:17:47 2016
@@ -86,6 +86,7 @@ public class ConcurrentUpdateSolrClient
   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
                                     int threadCount) {
     this(solrServerUrl, null, queueSize, threadCount);
     shutdownExecutor = true;
+    internalHttpClient = true;
   }
   
   public ConcurrentUpdateSolrClient(String solrServerUrl,
@@ -471,7 +473,7 @@ public class ConcurrentUpdateSolrClient
 
   @Override
   public void close() {
-    IOUtils.closeQuietly(client);
+    if (internalHttpClient) IOUtils.closeQuietly(client);
     if (shutdownExecutor) {
       scheduler.shutdown();
       try {
@@ -500,7 +502,7 @@ public class ConcurrentUpdateSolrClient
   }
 
   public void shutdownNow() {
-    IOUtils.closeQuietly(client);
+    if (internalHttpClient) IOUtils.closeQuietly(client);
     if (shutdownExecutor) {
       scheduler.shutdownNow(); // Cancel currently executing tasks
       try {



Mime
View raw message