Apache Solr open-source search software
LUCENE-1135: fix rare deadlock case in testAddIndexOnDiskFull
Michael McCandless088a42b846eb
diff --git a/src/java/org/apache/lucene/index/IndexWriter.java b/src/java/org/apache/lucene/index/IndexWriter.javaindex 8585e1a5e18..39101662d83 100644--- a/src/java/org/apache/lucene/index/IndexWriter.java+++ b/src/java/org/apache/lucene/index/IndexWriter.java@@ -4584,6 +4584,14 @@ public class IndexWriter {synchronized(this) {+ // sizeInBytes > 0 means this is an autoCommit at+ // the end of a merge. If at this point stopMerges+ // is true (which means a rollback() or+ // rollbackTransaction() is waiting for us to+ // finish), we skip the commit to avoid deadlock+ if (sizeInBytes > 0 && stopMerges)+ return;+// Wait for any running addIndexes to complete// first, then block any from running until we've// copied the segmentInfos we intend to sync: