Apache Lucene open-source search software
SOLR-4060: ReplicationHandler can try and do a snappull and open a new IndexWriter after shutdown has already occurred, leaving an IndexWriter that is not closed.
Mark Robert Miller9eb16eef21e4
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 2a81e613ff8..a6ab58ec80d 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -152,6 +152,10 @@ Bug Fixes* SOLR-4031: Upgrade to Jetty 8.1.7 to fix a bug where in very rare occasionsthe content of two concurrent requests get mixed up. (Per Steffensen, yonik)+* SOLR-4060: ReplicationHandler can try and do a snappull and open a new IndexWriter+ after shutdown has already occurred, leaving an IndexWriter that is not closed.+ (Mark Miller)+Other Changes----------------------diff --git a/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java b/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.javaindex 71ece45a6ad..11b40e2af01 100644--- a/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java+++ b/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java@@ -20,6 +20,7 @@ package org.apache.solr.update;import java.io.IOException;import org.apache.lucene.index.IndexWriter;+import org.apache.lucene.store.AlreadyClosedException;import org.apache.solr.cloud.RecoveryStrategy;import org.apache.solr.common.SolrException;import org.apache.solr.core.CoreContainer;@@ -114,6 +115,9 @@ public final class DefaultSolrCoreState extends SolrCoreState implements Recover@Overridepublic synchronized void newIndexWriter(SolrCore core, boolean rollback, boolean forceNewDir) throws IOException {+ if (closed) {+ throw new AlreadyClosedException("SolrCoreState already closed");+ }log.info("Creating new IndexWriter...");String coreName = core.getName();synchronized (writerPauseLock) {