lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1035693 - in /lucene/java/branches/lucene_3_0: CHANGES.txt src/java/org/apache/lucene/index/IndexWriter.java
Date Tue, 16 Nov 2010 16:54:26 GMT
Author: mikemccand
Date: Tue Nov 16 16:54:26 2010
New Revision: 1035693

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

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

Modified: lucene/java/branches/lucene_3_0/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_3_0/CHANGES.txt?rev=1035693&r1=1035692&r2=1035693&view=diff
==============================================================================
--- lucene/java/branches/lucene_3_0/CHANGES.txt (original)
+++ lucene/java/branches/lucene_3_0/CHANGES.txt Tue Nov 16 16:54:26 2010
@@ -87,6 +87,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_3_0/src/java/org/apache/lucene/index/IndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_3_0/src/java/org/apache/lucene/index/IndexWriter.java?rev=1035693&r1=1035692&r2=1035693&view=diff
==============================================================================
--- lucene/java/branches/lucene_3_0/src/java/org/apache/lucene/index/IndexWriter.java (original)
+++ lucene/java/branches/lucene_3_0/src/java/org/apache/lucene/index/IndexWriter.java Tue
Nov 16 16:54:26 2010
@@ -3361,7 +3361,9 @@ public class IndexWriter implements Clos
           
           } finally {
 
-            deleter.decRef(files);
+            synchronized(this) {
+              deleter.decRef(files);
+            }
 
             if (!success) {
               if (infoStream != null)
@@ -4533,7 +4535,9 @@ public class IndexWriter implements Clos
       if (merge.isAborted()) {
         if (infoStream != null)
           message("abort merge after building CFS");
-        deleter.deleteFile(compoundFileName);
+        synchronized(this) {
+          deleter.deleteFile(compoundFileName);
+        }
         return 0;
       }
 



Mime
View raw message