manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shinich...@apache.org
Subject svn commit: r1689580 - /manifoldcf/branches/CONNECTORS-1219/connectors/lucene/connector/src/main/java/org/apache/manifoldcf/agents/output/lucene/LuceneClient.java
Date Tue, 07 Jul 2015 06:36:18 GMT
Author: shinichiro
Date: Tue Jul  7 06:36:18 2015
New Revision: 1689580

URL: http://svn.apache.org/r1689580
Log:
Fix bug: need to close when reader become new reader, otherwise old reader keeps to hold index
segments

Modified:
    manifoldcf/branches/CONNECTORS-1219/connectors/lucene/connector/src/main/java/org/apache/manifoldcf/agents/output/lucene/LuceneClient.java

Modified: manifoldcf/branches/CONNECTORS-1219/connectors/lucene/connector/src/main/java/org/apache/manifoldcf/agents/output/lucene/LuceneClient.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1219/connectors/lucene/connector/src/main/java/org/apache/manifoldcf/agents/output/lucene/LuceneClient.java?rev=1689580&r1=1689579&r2=1689580&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1219/connectors/lucene/connector/src/main/java/org/apache/manifoldcf/agents/output/lucene/LuceneClient.java
(original)
+++ manifoldcf/branches/CONNECTORS-1219/connectors/lucene/connector/src/main/java/org/apache/manifoldcf/agents/output/lucene/LuceneClient.java
Tue Jul  7 06:36:18 2015
@@ -289,7 +289,10 @@ public class LuceneClient implements Clo
       realtimeReader = DirectoryReader.open(writer.getDirectory());
     }
     DirectoryReader newReader = DirectoryReader.openIfChanged(realtimeReader, writer, true);
-    if (newReader != null) realtimeReader = newReader;
+    if (newReader != null) {
+      realtimeReader.close();
+      realtimeReader = newReader;
+    }
   }
 
   public void commit() throws IOException {



Mime
View raw message