stop indexwriter waits on close

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1419665 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2012-12-10 18:55:06 +00:00
parent a0ccd37bb1
commit 81a14f54cd
2 changed files with 11 additions and 3 deletions

View File

@ -116,7 +116,7 @@ public abstract class CachingDirectoryFactory extends DirectoryFactory {
while(val.refCnt != 0) {
wait(100);
if (cnt++ >= 12000) {
if (cnt++ >= 1200) {
log.error("Timeout waiting for all directory ref counts to be released");
break;
}

View File

@ -84,8 +84,12 @@ public final class DefaultSolrCoreState extends SolrCoreState implements Recover
while (pauseWriter) {
try {
writerPauseLock.wait();
writerPauseLock.wait(100);
} catch (InterruptedException e) {}
if (closed) {
throw new RuntimeException("Already closed");
}
}
if (indexWriter == null) {
@ -128,8 +132,12 @@ public final class DefaultSolrCoreState extends SolrCoreState implements Recover
log.info("Waiting until IndexWriter is unused... core=" + coreName);
while (!writerFree) {
try {
writerPauseLock.wait();
writerPauseLock.wait(100);
} catch (InterruptedException e) {}
if (closed) {
throw new RuntimeException("Already closed");
}
}
try {