LUCENE-5390: Loosen assert in IW on pending event after close

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1556942 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Simon Willnauer 2014-01-09 20:31:40 +00:00
parent 23ae54b652
commit 98b31d86b2
1 changed files with 12 additions and 2 deletions

View File

@ -930,10 +930,20 @@ public class IndexWriter implements Closeable, TwoPhaseCommit{
closeInternal(waitForMerges, true);
}
}
assert eventQueue.isEmpty();
assert assertEventQueueAfterClose();
}
}
private boolean assertEventQueueAfterClose() {
if (eventQueue.isEmpty()) {
return true;
}
for (Event e : eventQueue) {
assert e instanceof DocumentsWriter.MergePendingEvent : e;
}
return true;
}
// Returns true if this thread should attempt to close, or
// false if IndexWriter is now closed; else, waits until
// another thread finishes closing
@ -2022,7 +2032,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit{
rollbackInternal();
}
}
assert eventQueue.isEmpty() : eventQueue;
assert assertEventQueueAfterClose();
}
private void rollbackInternal() throws IOException {