LUCENE-1376: catch BG merge exceptions even if all merges finish before FG thread (running optimize) advances to while loop

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@691964 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2008-09-04 11:14:04 +00:00
parent e6dcf14620
commit e398f4e930
1 changed files with 6 additions and 3 deletions

View File

@ -2333,9 +2333,7 @@ public class IndexWriter {
if (doWait) {
synchronized(this) {
while(optimizeMergesPending()) {
doWait();
while(true) {
if (mergeExceptions.size() > 0) {
// Forward any exceptions in background merge
// threads to the current thread:
@ -2351,6 +2349,11 @@ public class IndexWriter {
}
}
}
if (optimizeMergesPending())
doWait();
else
break;
}
}