wForget commented on code in PR #3959:
URL: https://github.com/apache/datafusion-comet/pull/3959#discussion_r3091522861


##########
spark/src/main/scala/org/apache/comet/CometExecIterator.scala:
##########
@@ -135,6 +135,11 @@ class CometExecIterator(
   private var currentBatch: ColumnarBatch = null
   private var closed: Boolean = false
 
+  // Register a task completion listener to ensure native resources are 
released when the task is done.
+  TaskContext.get().addTaskCompletionListener[Unit] { _ =>

Review Comment:
   Since `TaskContext.get()` has already been called, the new behavior should 
be safe.
   
   
https://github.com/apache/datafusion-comet/blob/29557ca898764057d8f314cb2334154030ba161e/spark/src/main/scala/org/apache/comet/CometExecIterator.scala#L79-L80



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to