Fix race in Lucene shutdown
After a ControlledRealTimeReopenThread is stopped, any NrtFutures depending on that thread will never finish; get() will hang forever. This means if there are any indexing operations happening in the WorkQueue after indexes are closed, they will never complete, causing a hang during WorkQueue#stop(). Swap the order that lifecycle listeners are registered between the index module and the work queue, so that the work queue is shut down first, and the reopen threads don't shut down and leave stranded tasks. Change-Id: I005315336178234a974cde0ac2e51f1e04fbd999
This commit is contained in:
@@ -243,6 +243,9 @@ public class SubIndex {
|
||||
} else if (isGenAvailableNowForCurrentSearcher()) {
|
||||
set(null);
|
||||
return true;
|
||||
} else if (!reopenThread.isAlive()) {
|
||||
setException(new IllegalStateException("NRT thread is dead"));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user