From 0e5b5cb4ed1301bdb79aca5282a57aa816db8e22 Mon Sep 17 00:00:00 2001 From: Alessandro Bellina Date: Thu, 19 Dec 2024 11:01:40 -0600 Subject: [PATCH] Make sure that the chunked packer bounce buffer is realease after the synchronize (#11887) 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") }