s1monw commented on PR #12549: URL: https://github.com/apache/lucene/pull/12549#issuecomment-1778953836
I think this is only triggered because of your change but the problem was already there. We hold the lock in MDW#close() such that we can not run a concurrent merge. We could either prevent the merge with something like this: ```diff index bc1f95e0b58..f9acdd55793 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/tests/store/MockDirectoryWrapper.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/store/MockDirectoryWrapper.java @@ -970,7 +970,10 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper { DirectoryReader ir1 = DirectoryReader.open(this); int numDocs1 = ir1.numDocs(); ir1.close(); - new IndexWriter(this, new IndexWriterConfig(null)).close(); + new IndexWriter(this, new IndexWriterConfig(null) + .setCommitOnClose(false) + .setMaxFullFlushMergeWaitMillis(0)) + .close(); DirectoryReader ir2 = DirectoryReader.open(this); int numDocs2 = ir2.numDocs(); ir2.close(); ``` or use a `SerialMergeScheduler` to run the merge in the caller thread. I would opt for the MergeScheduler. WDYT -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org