mirror of https://github.com/apache/lucene.git
SOLR-4178: ReplicationHandler should abort any current pulls and wait for it's executor to stop during core close.
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1421078 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
38d16dc7b7
commit
ce0cc401ff
|
@ -343,6 +343,9 @@ Bug Fixes
|
||||||
* SOLR-4102: Fix UI javascript error if canonical hostname can not be resolved
|
* SOLR-4102: Fix UI javascript error if canonical hostname can not be resolved
|
||||||
(steffkes via hossman)
|
(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
|
Other Changes
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
|
|
|
@ -150,6 +150,9 @@ public abstract class CachingDirectoryFactory extends DirectoryFactory {
|
||||||
|
|
||||||
private void close(Directory directory) throws IOException {
|
private void close(Directory directory) throws IOException {
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
|
if (closed) {
|
||||||
|
throw new RuntimeException("Already closed");
|
||||||
|
}
|
||||||
|
|
||||||
CacheValue cacheValue = byDirectoryCache.get(directory);
|
CacheValue cacheValue = byDirectoryCache.get(directory);
|
||||||
if (cacheValue == null) {
|
if (cacheValue == null) {
|
||||||
|
|
|
@ -71,7 +71,6 @@ import org.apache.http.client.HttpClient;
|
||||||
import org.apache.lucene.index.IndexCommit;
|
import org.apache.lucene.index.IndexCommit;
|
||||||
import org.apache.lucene.index.IndexWriter;
|
import org.apache.lucene.index.IndexWriter;
|
||||||
import org.apache.lucene.store.Directory;
|
import org.apache.lucene.store.Directory;
|
||||||
import org.apache.lucene.store.IOContext;
|
|
||||||
import org.apache.lucene.store.IndexInput;
|
import org.apache.lucene.store.IndexInput;
|
||||||
import org.apache.lucene.store.IndexOutput;
|
import org.apache.lucene.store.IndexOutput;
|
||||||
import org.apache.solr.client.solrj.SolrServer;
|
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.CommonParams;
|
||||||
import org.apache.solr.common.params.ModifiableSolrParams;
|
import org.apache.solr.common.params.ModifiableSolrParams;
|
||||||
import org.apache.solr.common.params.SolrParams;
|
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.FastInputStream;
|
||||||
import org.apache.solr.common.util.NamedList;
|
import org.apache.solr.common.util.NamedList;
|
||||||
import org.apache.solr.core.CachingDirectoryFactory.CloseListener;
|
import org.apache.solr.core.CachingDirectoryFactory.CloseListener;
|
||||||
import org.apache.solr.core.DirectoryFactory;
|
import org.apache.solr.core.DirectoryFactory;
|
||||||
import org.apache.solr.core.IndexDeletionPolicyWrapper;
|
import org.apache.solr.core.IndexDeletionPolicyWrapper;
|
||||||
import org.apache.solr.core.NRTCachingDirectoryFactory;
|
|
||||||
import org.apache.solr.core.SolrCore;
|
import org.apache.solr.core.SolrCore;
|
||||||
import org.apache.solr.handler.ReplicationHandler.FileInfo;
|
import org.apache.solr.handler.ReplicationHandler.FileInfo;
|
||||||
import org.apache.solr.request.LocalSolrQueryRequest;
|
import org.apache.solr.request.LocalSolrQueryRequest;
|
||||||
|
@ -1581,6 +1580,8 @@ public class SnapPuller {
|
||||||
|
|
||||||
public void destroy() {
|
public void destroy() {
|
||||||
if (executorService != null) executorService.shutdown();
|
if (executorService != null) executorService.shutdown();
|
||||||
|
abortPull();
|
||||||
|
if (executorService != null) ExecutorUtil.shutdownAndAwaitTermination(executorService);
|
||||||
}
|
}
|
||||||
|
|
||||||
String getMasterUrl() {
|
String getMasterUrl() {
|
||||||
|
|
Loading…
Reference in New Issue