lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r696005 - /lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java
Date Tue, 16 Sep 2008 18:49:17 GMT
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:



Mime
View raw message