mirror of https://github.com/apache/lucene.git
Fix file handle leak in Lucene99ScalarQuantizedVectorsWriter. (#12739)
If `mergeQuantizedByteVectorValues` fails with an exception, the temp output never gets closed. This was found by the test that throws random exceptions.
This commit is contained in:
parent
85f5d3bb0b
commit
361f0a4524
|
@ -260,7 +260,7 @@ public final class Lucene99ScalarQuantizedVectorsWriter implements Accountable {
|
||||||
quantizationDataInput)));
|
quantizationDataInput)));
|
||||||
} finally {
|
} finally {
|
||||||
if (success == false) {
|
if (success == false) {
|
||||||
IOUtils.closeWhileHandlingException(quantizationDataInput);
|
IOUtils.closeWhileHandlingException(tempQuantizedVectorData, quantizationDataInput);
|
||||||
IOUtils.deleteFilesIgnoringExceptions(
|
IOUtils.deleteFilesIgnoringExceptions(
|
||||||
segmentWriteState.directory, tempQuantizedVectorData.getName());
|
segmentWriteState.directory, tempQuantizedVectorData.getName());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue