mirror of https://github.com/apache/lucene.git
LUCENE-1639: fix case where doc stores are incorrectly double opened, thus leaving open file handles after IndexWriter is closed
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@786545 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0b5cbca110
commit
ec65df2156
|
@ -4829,7 +4829,7 @@ public class IndexWriter {
|
|||
}
|
||||
|
||||
for(int i=0;i<numSegments;i++) {
|
||||
merge.readersClone[i].openDocStores();
|
||||
merge.readersClone[i].openDocStores(merge.readers[i]);
|
||||
}
|
||||
|
||||
// Clear DSS
|
||||
|
|
|
@ -133,6 +133,9 @@ public abstract class MergePolicy {
|
|||
b.append(" into ").append(info.name);
|
||||
if (optimize)
|
||||
b.append(" [optimize]");
|
||||
if (mergeDocStores) {
|
||||
b.append(" [mergeDocStores]");
|
||||
}
|
||||
return b.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -475,6 +475,17 @@ class SegmentReader extends IndexReader implements Cloneable {
|
|||
return instance;
|
||||
}
|
||||
|
||||
synchronized void openDocStores(SegmentReader orig) throws IOException {
|
||||
if (fieldsReaderOrig == null) {
|
||||
orig.openDocStores();
|
||||
|
||||
fieldsReaderOrig = orig.fieldsReaderOrig;
|
||||
termVectorsReaderOrig = orig.termVectorsReaderOrig;
|
||||
storeCFSReader = orig.storeCFSReader;
|
||||
cfsReader = orig.cfsReader;
|
||||
}
|
||||
}
|
||||
|
||||
synchronized void openDocStores() throws IOException {
|
||||
if (fieldsReaderOrig == null) {
|
||||
final Directory storeDir;
|
||||
|
|
Loading…
Reference in New Issue