Apache Solr open-source search software
SOLR-4178: ReplicationHandler should abort any current pulls and wait for it's executor to stop during core close.
Mark Robert Millerce0cc401ffcc
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 8529d47a4c5..513a5cc0f4a 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -343,6 +343,9 @@ Bug Fixes* SOLR-4102: Fix UI javascript error if canonical hostname can not be resolved(steffkes via hossman)+* SOLR-4178: ReplicationHandler should abort any current pulls and wait for+ it's executor to stop during core close. (Mark Miller)+Other Changes----------------------diff --git a/solr/core/src/java/org/apache/solr/core/CachingDirectoryFactory.java b/solr/core/src/java/org/apache/solr/core/CachingDirectoryFactory.javaindex ee0d68397f7..f6ac3ef2c92 100644--- a/solr/core/src/java/org/apache/solr/core/CachingDirectoryFactory.java+++ b/solr/core/src/java/org/apache/solr/core/CachingDirectoryFactory.java@@ -150,6 +150,9 @@ public abstract class CachingDirectoryFactory extends DirectoryFactory {private void close(Directory directory) throws IOException {synchronized (this) {+ if (closed) {+ throw new RuntimeException("Already closed");+ }CacheValue cacheValue = byDirectoryCache.get(directory);if (cacheValue == null) {diff --git a/solr/core/src/java/org/apache/solr/handler/SnapPuller.java b/solr/core/src/java/org/apache/solr/handler/SnapPuller.javaindex 8854bf4e34b..a5f718857c9 100644--- a/solr/core/src/java/org/apache/solr/handler/SnapPuller.java+++ b/solr/core/src/java/org/apache/solr/handler/SnapPuller.java@@ -71,7 +71,6 @@ import org.apache.http.client.HttpClient;import org.apache.lucene.index.IndexCommit;import org.apache.lucene.index.IndexWriter;import org.apache.lucene.store.Directory;-import org.apache.lucene.store.IOContext;import org.apache.lucene.store.IndexInput;import org.apache.lucene.store.IndexOutput;import org.apache.solr.client.solrj.SolrServer;@@ -83,12 +82,12 @@ import org.apache.solr.common.SolrException;import org.apache.solr.common.params.CommonParams;import org.apache.solr.common.params.ModifiableSolrParams;import org.apache.solr.common.params.SolrParams;+import org.apache.solr.common.util.ExecutorUtil;import org.apache.solr.common.util.FastInputStream;import org.apache.solr.common.util.NamedList;import org.apache.solr.core.CachingDirectoryFactory.CloseListener;import org.apache.solr.core.DirectoryFactory;import org.apache.solr.core.IndexDeletionPolicyWrapper;-import org.apache.solr.core.NRTCachingDirectoryFactory;import org.apache.solr.core.SolrCore;import org.apache.solr.handler.ReplicationHandler.FileInfo;import org.apache.solr.request.LocalSolrQueryRequest;@@ -1581,6 +1580,8 @@ public class SnapPuller {public void destroy() {if (executorService != null) executorService.shutdown();+ abortPull();+ if (executorService != null) ExecutorUtil.shutdownAndAwaitTermination(executorService);}String getMasterUrl() {