Skip to content

fix(arrow): Defer release callbacks until the vector is destroyed (mhaseeb123 2026-09-10 option 1) - #15

Open
simoneves wants to merge 1 commit into
simoneves/redo_of_kjmph_tpcds_decimal_fixes_squashed_rebasedfrom
simoneves/haseeb_fix_2a_20260910
Open

fix(arrow): Defer release callbacks until the vector is destroyed (mhaseeb123 2026-09-10 option 1)#15
simoneves wants to merge 1 commit into
simoneves/redo_of_kjmph_tpcds_decimal_fixes_squashed_rebasedfrom
simoneves/haseeb_fix_2a_20260910

Conversation

@simoneves

Copy link
Copy Markdown
Owner

importFromArrowAsOwner documents that the returned vector calls the ArrowSchema and ArrowArray release callbacks when it is destroyed. Import paths that copy Arrow data ran them before the import call had even returned. Times, timestamps and several decimal layouts copy their values rather than viewing them. When null_count is zero there is no nulls buffer to view either, so nothing referenced the Arrow structures at all.

Nothing dangled, because a vector built from copied values holds no pointer into Arrow memory. A producer that frees or unrefs its own state from a release callback still saw that happen while the caller was holding the vector.

Ownership used to travel only through the buffer views placed over Arrow memory. The returned vector now owns the two releasers directly, so release timing no longer depends on whether a path viewed or copied its input. Its deleter drops the vector before the releasers, so that buffer views on the viewing paths are gone before the callbacks free what they reference.

`importFromArrowAsOwner` documents that the returned vector calls the `ArrowSchema` and `ArrowArray` release callbacks when it is destroyed. Import paths that copy Arrow data ran them before the import call had even returned. Times, timestamps and several decimal layouts copy their values rather than viewing them. When `null_count` is zero there is no nulls buffer to view either, so nothing referenced the Arrow structures at all.

Nothing dangled, because a vector built from copied values holds no pointer into Arrow memory. A producer that frees or unrefs its own state from a release callback still saw that happen while the caller was holding the vector.

Ownership used to travel only through the buffer views placed over Arrow memory. The returned vector now owns the two releasers directly, so release timing no longer depends on whether a path viewed or copied its input. Its deleter drops the vector before the releasers, so that buffer views on the viewing paths are gone before the callbacks free what they reference.
@simoneves simoneves changed the title fix(arrow): Defer release callbacks until the vector is destroyed fix(arrow): Defer release callbacks until the vector is destroyed (mhaseeb123 2026-09-10) Sep 10, 2026
@simoneves simoneves changed the title fix(arrow): Defer release callbacks until the vector is destroyed (mhaseeb123 2026-09-10) fix(arrow): Defer release callbacks until the vector is destroyed (mhaseeb123 2026-09-10 option 1) Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant