zacharymorn commented on a change in pull request #128: URL: https://github.com/apache/lucene/pull/128#discussion_r697141222
########## File path: lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java ########## @@ -895,7 +895,11 @@ public synchronized void close() throws IOException { System.out.println("\nNOTE: MockDirectoryWrapper: now run CheckIndex"); } - TestUtil.checkIndex(this, getCrossCheckTermVectorsOnClose(), true, null); + // Methods in MockDirectoryWrapper hold locks on this, which will cause deadlock when + // TestUtil#checkIndex checks segment concurrently using another thread, but making + // call back to synchronized methods such as MockDirectoryWrapper#fileLength. + // Hence passing concurrent = false to this method to turn off concurrent checks. + TestUtil.checkIndex(this, getCrossCheckTermVectorsOnClose(), true, false, null); Review comment: > Maybe open a follow-on issue to fix this sync situation so that we could, randomly, sometimes use concurrency in CheckIndex from tests? Sounds good. I've created this issue https://issues.apache.org/jira/browse/LUCENE-10071 for following up on this. > Maybe we could start by making some of the TestUtil.checkIndex use concurrency, just not the one that MDW invokes? Yes this is already done in https://github.com/apache/lucene/pull/128/commits/138b72e9f2512df257c9acf01516bd071c9fb1d4, where `CheckIndex#checkIndex` got a new parameter `concurrent`, and most of the invocations except the one in MDW would pass in `true` to enable concurrency. -- 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