Describe the bug, including details regarding any error messages, version, and platform.
The current implementation of array and record batch importation in Go sets a finalizer to trigger the release callback when any reference to the underlying ArrayData is collected.
Unfortunately, Go finalizers are unreliable and even a GC run is not necessarily sufficient to get them invoked.
Relevant excerpts from https://pkg.go.dev/runtime#SetFinalizer :
The finalizer is scheduled to run at some arbitrary time after the program can no longer reach the object to which obj points. There is no guarantee that finalizers will run before a program exits, so typically they are useful only for releasing non-memory resources associated with an object during a long-running program.
A single goroutine runs all finalizers for a program, sequentially.
Component(s)
Go