AynSiddiqui commented on code in PR #1643:
URL: https://github.com/apache/arrow-go/pull/1643#discussion_r4648676392
##########
arrow/cdata/exports.go:
##########
@@ -332,7 +332,12 @@ func asyncProducerCancel(producer *CArrowAsyncProducer) {
func asyncTaskExtract(task *CArrowAsyncTask, out *CArrowDeviceArray) C.int {
h := getHandle(task.private_data)
rec := h.Value().(arrow.RecordBatch)
- defer rec.Release()
+ // extract_data runs once per task and owns the task's handle and slot
+ defer func() {
+ rec.Release()
+ h.Delete()
+ C.free(task.private_data)
Review Comment:
Done in 51758329: `asyncTaskExtract` now returns `EINVAL` when
`private_data` is nil on entry, and sets `task.private_data = nil` after
freeing it. Added `TestAsyncTaskExtractTwice` (second call returns `EINVAL`);
without the change it panics on the already-deleted handle.
I left the busy-wait in the test producer as is, since the test always
cancels.
--
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]