mirror of https://github.com/apache/lucene.git
LUCENE-8785: Ensure threadstates are locked before iterating (#664)
Ensure new threadstates are locked before retrieving the number of active threadstates. This causes assertion errors and potentially broken field attributes in the IndexWriter when IndexWriter#deleteAll is called while actively indexing.
This commit is contained in:
parent
3fa2d8f1d3
commit
e8d88a5b54
|
@ -452,7 +452,11 @@ Optimizations
|
|||
(Toke Eskildsen, Adrien Grand)
|
||||
|
||||
======================= Lucene 7.7.1 =======================
|
||||
(No Changes)
|
||||
Bug fixes:
|
||||
|
||||
* LUCENE-8785: Ensure new threadstates are locked before retrieving the number of active threadstates.
|
||||
This causes assertion errors and potentially broken field attributes in the IndexWriter when
|
||||
IndexWriter#deleteAll is called while actively indexing. (Simon Willnauer)
|
||||
|
||||
======================= Lucene 7.7.0 =======================
|
||||
|
||||
|
|
|
@ -287,8 +287,8 @@ final class DocumentsWriter implements Closeable, Accountable {
|
|||
};
|
||||
try {
|
||||
deleteQueue.clear();
|
||||
final int limit = perThreadPool.getMaxThreadStates();
|
||||
perThreadPool.lockNewThreadStates();
|
||||
final int limit = perThreadPool.getMaxThreadStates();
|
||||
for (int i = 0; i < limit; i++) {
|
||||
final ThreadState perThread = perThreadPool.getThreadState(i);
|
||||
perThread.lock();
|
||||
|
|
Loading…
Reference in New Issue