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 2010/11/16 17:54:09 UTC

svn commit: r1035692 - in /lucene/java/branches/lucene_2_9: CHANGES.txt src/java/org/apache/lucene/index/IndexWriter.java

Author: mikemccand
Date: Tue Nov 16 16:54:09 2010
New Revision: 1035692

URL: http://svn.apache.org/viewvc?rev=1035692&view=rev
Log:
LUCENE-2767: add 2 missing sync's in IW when it invokes IFD

Modified:
    lucene/java/branches/lucene_2_9/CHANGES.txt
    lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/index/IndexWriter.java

Modified: lucene/java/branches/lucene_2_9/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_9/CHANGES.txt?rev=1035692&r1=1035691&r2=1035692&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_9/CHANGES.txt (original)
+++ lucene/java/branches/lucene_2_9/CHANGES.txt Tue Nov 16 16:54:09 2010
@@ -89,6 +89,10 @@ Bug fixes
   IndexWriter.optimize could sometimes return even though the index
   wasn't fully optimized (Mike McCandless)
 
+* LUCENE-2767: Fix thread safety issue in addIndexes(IndexReader[])
+  that could potentially result in index corruption.  (Mike
+  McCandless)
+
 Optimizations
 
 * LUCENE-2556: Improve memory usage after cloning TermAttribute.

Modified: lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/index/IndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/index/IndexWriter.java?rev=1035692&r1=1035691&r2=1035692&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/index/IndexWriter.java (original)
+++ lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/index/IndexWriter.java Tue Nov 16 16:54:09 2010
@@ -4018,7 +4018,9 @@ public class IndexWriter {
           
           } finally {
 
-            deleter.decRef(files);
+            synchronized(this) {
+              deleter.decRef(files);
+            }
 
             if (!success) {
               if (infoStream != null)
@@ -5285,7 +5287,9 @@ public class IndexWriter {
       if (merge.isAborted()) {
         if (infoStream != null)
           message("abort merge after building CFS");
-        deleter.deleteFile(compoundFileName);
+        synchronized(this) {
+          deleter.deleteFile(compoundFileName);
+        }
         return 0;
       }