Skip to content

Commit aac200a

Browse files
committed
Add synchronized
1 parent 0068105 commit aac200a

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎common/src/main/scala/org/apache/spark/sql/comet/execution/shuffle/ArrowReaderIterator.scala‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ class ArrowReaderIterator(channel: ReadableByteChannel, source: String)
4040
// Release the previous batch.
4141
// If it is not released, when closing the reader, arrow library will complain about
4242
// memory leak.
43-
if (currentBatch != null) {
44-
currentBatch.close()
43+
synchronized {
44+
if (currentBatch != null) {
45+
currentBatch.close()
46+
}
4547
}
4648

4749
batch = nextBatch()

0 commit comments

Comments
 (0)