Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -320,15 +320,17 @@ private Function<Object, Object> genericsConvert(SeaTunnelDataType dataType) {
@Override
public void close() {
try {
if (root != null) {
root.close();
// ArrowStreamReader must be closed before RootAllocator.
// ArrowStreamReader internally closes VectorSchemaRoot and releases all Arrow
// buffer allocations back to the allocator. If the allocator is closed first,
// it detects unreleased memory and throws IllegalStateException ("Memory was
// leaked by query"), which is the root cause of issue #9863.
if (arrowStreamReader != null) {
arrowStreamReader.close();
}
if (rootAllocator != null) {
rootAllocator.close();
}
if (arrowStreamReader != null) {
arrowStreamReader.close();
}
} catch (IOException e) {
throw new RuntimeException("failed to close arrow stream reader.", e);
}
Expand Down
Loading