From a19bfb47ed6dd958aca0f929653dd4a0ef4e55c0 Mon Sep 17 00:00:00 2001 From: Alessandro Bellina Date: Wed, 18 Dec 2024 12:24:41 -0800 Subject: [PATCH] Make sure that the chunked packer bounce buffer is realease after the synchronize Signed-off-by: Alessandro Bellina --- .../scala/com/nvidia/spark/rapids/spill/SpillFramework.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql-plugin/src/main/scala/com/nvidia/spark/rapids/spill/SpillFramework.scala b/sql-plugin/src/main/scala/com/nvidia/spark/rapids/spill/SpillFramework.scala index 57f2a823432..91421a37c64 100644 --- a/sql-plugin/src/main/scala/com/nvidia/spark/rapids/spill/SpillFramework.scala +++ b/sql-plugin/src/main/scala/com/nvidia/spark/rapids/spill/SpillFramework.scala @@ -1719,7 +1719,7 @@ class ChunkedPacker(table: Table, } override def next(): (DeviceBounceBuffer, Long) = { - withResource(bounceBufferPool.nextBuffer()) { bounceBuffer => + closeOnExcept(bounceBufferPool.nextBuffer()) { bounceBuffer => if (closed) { throw new IllegalStateException(s"ChunkedPacker is closed") }