diff --git a/common/src/main/scala/org/apache/spark/sql/comet/execution/shuffle/ArrowReaderIterator.scala b/common/src/main/scala/org/apache/spark/sql/comet/execution/shuffle/ArrowReaderIterator.scala index b06892e4c..3c0fa153d 100644 --- a/common/src/main/scala/org/apache/spark/sql/comet/execution/shuffle/ArrowReaderIterator.scala +++ b/common/src/main/scala/org/apache/spark/sql/comet/execution/shuffle/ArrowReaderIterator.scala @@ -40,10 +40,8 @@ class ArrowReaderIterator(channel: ReadableByteChannel, source: String) // Release the previous batch. // If it is not released, when closing the reader, arrow library will complain about // memory leak. - synchronized { - if (currentBatch != null) { - currentBatch.close() - } + if (currentBatch != null) { + currentBatch.close() } batch = nextBatch()