mirror of https://github.com/apache/lucene.git
SOLR-4161: add a little more protection
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1420500 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
50407282a7
commit
8472da6e82
|
@ -74,6 +74,11 @@ public final class DefaultSolrCoreState extends SolrCoreState implements Recover
|
|||
@Override
|
||||
public synchronized RefCounted<IndexWriter> getIndexWriter(SolrCore core)
|
||||
throws IOException {
|
||||
|
||||
if (closed) {
|
||||
throw new RuntimeException("SolrCoreState already closed");
|
||||
}
|
||||
|
||||
synchronized (writerPauseLock) {
|
||||
if (core == null) {
|
||||
// core == null is a signal to just return the current writer, or null
|
||||
|
@ -136,7 +141,7 @@ public final class DefaultSolrCoreState extends SolrCoreState implements Recover
|
|||
} catch (InterruptedException e) {}
|
||||
|
||||
if (closed) {
|
||||
throw new RuntimeException("Already closed");
|
||||
throw new RuntimeException("SolrCoreState already closed");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue