Skip to content

Commit c3ee021

Browse files
authored
[CI] EnrichIT class failing (#137287)
- Fix docs vector memory leak
1 parent 84014cd commit c3ee021

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/topn/ResultBuilderForDoc.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,19 @@ public Block build() {
5252
boolean success = false;
5353
IntVector shardsVector = null;
5454
IntVector segmentsVector = null;
55+
IntVector docsVector = null;
56+
5557
try {
5658
shardsVector = blockFactory.newIntArrayVector(shards, position);
5759
segmentsVector = blockFactory.newIntArrayVector(segments, position);
58-
var docsVector = blockFactory.newIntArrayVector(docs, position);
60+
docsVector = blockFactory.newIntArrayVector(docs, position);
5961
var docsBlock = DocVector.withoutIncrementingShardRefCounts(encoder.refCounteds(), shardsVector, segmentsVector, docsVector)
6062
.asBlock();
6163
success = true;
6264
return docsBlock;
6365
} finally {
6466
if (success == false) {
65-
Releasables.closeExpectNoException(shardsVector, segmentsVector);
67+
Releasables.closeExpectNoException(shardsVector, segmentsVector, docsVector);
6668
}
6769
}
6870
}

0 commit comments

Comments
 (0)