You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@lucene.apache.org by mi...@apache.org on 2008/09/16 20:49:17 UTC

svn commit: r696005 - /lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java

Author: mikemccand
Date: Tue Sep 16 11:49:16 2008
New Revision: 696005

URL: http://svn.apache.org/viewvc?rev=696005&view=rev
Log:
LUCENE-1135: fix rare deadlock case in testAddIndexOnDiskFull

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java?rev=696005&r1=696004&r2=696005&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java Tue Sep 16 11:49:16 2008
@@ -4584,6 +4584,14 @@
 
       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: