mirror of https://github.com/apache/lucene.git
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:
parent
23ae54b652
commit
98b31d86b2
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue