File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed
lucene/test-framework/src/java/org/apache/lucene/tests/store Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change 4646import org .apache .lucene .index .IndexWriterConfig ;
4747import org .apache .lucene .index .NoDeletionPolicy ;
4848import org .apache .lucene .index .SegmentInfos ;
49- import org .apache .lucene .index .SerialMergeScheduler ;
5049import org .apache .lucene .store .AlreadyClosedException ;
5150import org .apache .lucene .store .ChecksumIndexInput ;
5251import org .apache .lucene .store .Directory ;
@@ -971,12 +970,8 @@ public synchronized void close() throws IOException {
971970 DirectoryReader ir1 = DirectoryReader .open (this );
972971 int numDocs1 = ir1 .numDocs ();
973972 ir1 .close ();
974- // Use a serial merge scheduler, otherwise merges may be scheduled on a different thread
975- // and will deadlock since the lock on `this` is already taken by close(), so
976- // createOutput() won't be able to take it.
977- new IndexWriter (
978- this , new IndexWriterConfig (null ).setCommitOnClose (false ))
979- .close ();
973+ // Don't commit on close, so that no merges will be scheduled.
974+ new IndexWriter (this , new IndexWriterConfig (null ).setCommitOnClose (false )).close ();
980975 DirectoryReader ir2 = DirectoryReader .open (this );
981976 int numDocs2 = ir2 .numDocs ();
982977 ir2 .close ();
You can’t perform that action at this time.
0 commit comments