mirror of https://github.com/apache/lucene.git
LUCENE-3032: TestIndexWriterException fails with NPE on realtime
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/realtime_search@1092627 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
95b0aa44da
commit
f90bf1aee8
|
@ -325,9 +325,13 @@ public class DocumentsWriterPerThread {
|
|||
FrozenBufferedDeletes prepareFlush() {
|
||||
assert numDocsInRAM > 0;
|
||||
final FrozenBufferedDeletes globalDeletes = deleteQueue.freezeGlobalBuffer(deleteSlice);
|
||||
// apply all deletes before we flush and release the delete slice
|
||||
deleteSlice.apply(pendingDeletes, numDocsInRAM);
|
||||
deleteSlice = null;
|
||||
/* deleteSlice can possibly be null if we have hit non-aborting exceptions during indexing and never succeeded
|
||||
adding a document. */
|
||||
if (deleteSlice != null) {
|
||||
// apply all deletes before we flush and release the delete slice
|
||||
deleteSlice.apply(pendingDeletes, numDocsInRAM);
|
||||
deleteSlice = null;
|
||||
}
|
||||
return globalDeletes;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue