The GitHub Actions job "Go Integration" on 
iceberg-go.git/fix/enrich-records-arrow-refcount-leak has failed.
Run started by GitHub user laskoviymishka (triggered by laskoviymishka).

Head commit for run:
a6f79f4f8d1c238bb3ab88e2ce0ead8e496c42c7 / laskoviymishka 
<[email protected]>
fix(table): fix arrow array refcount leak in enrichRecordsWithPosDeleteFields

Arrays returned by NewArray() have refcount=1. NewRecordBatch calls
Retain() on each column, bumping to refcount=2. Without an explicit
Release() on the temporary arrays, the count never drops back to 1
when the record batch is released by the caller.

Fix by assigning NewArray() results to local variables and deferring
their Release(), so the lifecycle is: NewArray() -> refcount 1,
NewRecordBatch Retain() -> refcount 2, deferred Release() -> refcount 1
(owned by outData), caller releases outData -> refcount 0 -> freed.

Also extend TestEnrichRecordsWithPosDeleteFields to use
memory.NewCheckedAllocator with mem.AssertSize(t, 0) to catch this
class of leak going forward.

Fixes leak introduced in #721.

Report URL: https://github.com/apache/iceberg-go/actions/runs/22528326046

With regards,
GitHub Actions via GitBox

Reply via email to