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 10:35:10 UTC

(lucene) branch main 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 main
in repository https://gitbox.apache.org/repos/asf/lucene.git


The following commit(s) were added to refs/heads/main by this push:
     new 361f0a4524d Fix file handle leak in Lucene99ScalarQuantizedVectorsWriter. (#12739)
361f0a4524d is described below

commit 361f0a4524d93fc1a793aa72bfcc91c00fa3599e
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 c0485810fc8..613fa89b020 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());
       }