mirror of
https://github.com/apache/lucene.git
synced 2025-02-08 02:58:58 +00:00
fix not-closing-on-exc bugs in BloomFilteringPF
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/slowclosing@1393552 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c4a735490e
commit
4485a42a03
@ -159,6 +159,7 @@ public final class BloomFilteringPostingsFormat extends PostingsFormat {
|
||||
String bloomFileName = IndexFileNames.segmentFileName(
|
||||
state.segmentInfo.name, state.segmentSuffix, BLOOM_EXTENSION);
|
||||
IndexInput bloomIn = null;
|
||||
boolean success = false;
|
||||
try {
|
||||
bloomIn = state.dir.openInput(bloomFileName, state.context);
|
||||
CodecUtil.checkHeader(bloomIn, BLOOM_CODEC_NAME, BLOOM_CODEC_VERSION,
|
||||
@ -178,8 +179,13 @@ public final class BloomFilteringPostingsFormat extends PostingsFormat {
|
||||
FieldInfo fieldInfo = state.fieldInfos.fieldInfo(fieldNum);
|
||||
bloomsByFieldName.put(fieldInfo.name, bloom);
|
||||
}
|
||||
success = true;
|
||||
} finally {
|
||||
IOUtils.close(bloomIn);
|
||||
if (!success) {
|
||||
IOUtils.close(bloomIn, delegateFieldsProducer);
|
||||
} else {
|
||||
IOUtils.close(bloomIn);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user