Skip to content

Commit 03a0f07

Browse files
committed
Fix comment.
1 parent 5e87da8 commit 03a0f07

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

lucene/test-framework/src/java/org/apache/lucene/tests/store/MockDirectoryWrapper.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
import org.apache.lucene.index.IndexWriterConfig;
4747
import org.apache.lucene.index.NoDeletionPolicy;
4848
import org.apache.lucene.index.SegmentInfos;
49-
import org.apache.lucene.index.SerialMergeScheduler;
5049
import org.apache.lucene.store.AlreadyClosedException;
5150
import org.apache.lucene.store.ChecksumIndexInput;
5251
import 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();

0 commit comments

Comments
 (0)