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.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1407817 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2012-11-10 14:11:05 +00:00
parent b57d801ae3
commit 9eb16eef21
2 changed files with 8 additions and 0 deletions

View File

@ -152,6 +152,10 @@ Bug Fixes
* SOLR-4031: Upgrade to Jetty 8.1.7 to fix a bug where in very rare occasions
the 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
----------------------

View File

@ -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
@Override
public 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) {