You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by jp...@apache.org on 2023/10/31 14:40:01 UTC
(lucene) branch branch_9x updated: Fix file handle leak in Lucene99ScalarQuantizedVectorsWriter. (#12739)
This is an automated email from the ASF dual-hosted git repository.
jpountz pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/lucene.git
The following commit(s) were added to refs/heads/branch_9x by this push:
new d44eef7b3b1 Fix file handle leak in Lucene99ScalarQuantizedVectorsWriter. (#12739)
d44eef7b3b1 is described below
commit d44eef7b3b100c8ad4fba16fd3b18bc0addcd6ec
Author: Adrien Grand <jp...@gmail.com>
AuthorDate: Tue Oct 31 11:35:05 2023 +0100
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.
---
.../lucene/codecs/lucene99/Lucene99ScalarQuantizedVectorsWriter.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene99/Lucene99ScalarQuantizedVectorsWriter.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene99/Lucene99ScalarQuantizedVectorsWriter.java
index be9454c14aa..3323591908b 100644
--- a/lucene/core/src/java/org/apache/lucene/codecs/lucene99/Lucene99ScalarQuantizedVectorsWriter.java
+++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene99/Lucene99ScalarQuantizedVectorsWriter.java
@@ -260,7 +260,7 @@ public final class Lucene99ScalarQuantizedVectorsWriter implements Accountable {
quantizationDataInput)));
} finally {
if (success == false) {
- IOUtils.closeWhileHandlingException(quantizationDataInput);
+ IOUtils.closeWhileHandlingException(tempQuantizedVectorData, quantizationDataInput);
IOUtils.deleteFilesIgnoringExceptions(
segmentWriteState.directory, tempQuantizedVectorData.getName());
}