Skip to content

[client] Close remaining Arrow resources if scanner close fails - #4350

Open
EchoLee5 wants to merge 2 commits into
apache:mainfrom
EchoLee5:fix-4345-scanner-close-leak
Open

EchoLee5 wants to merge 2 commits into
apache:mainfrom
EchoLee5:fix-4345-scanner-close-leak

Conversation

@EchoLee5

Copy link
Copy Markdown

Summary

Test Plan

  • mvn test -Dtest=LogRecordReadContextTest -pl fluss-common -am
  • mvn test -Dtest=LogFetcherTest,LogScannerImplTest -pl fluss-client -am
  • Spotless / Checkstyle on the affected modules

🤖 AI-assisted changes - reviewed by human developer

Made with Cursor

A failure mid-chain skipped later close() calls and leaked off-heap
Arrow memory. Close every allocator with IOUtils.closeAll(), and
release polled batches if sendFetches() throws after poll.

Fixes apache#4345

Co-authored-by: Cursor <cursoragent@cursor.com>
@EchoLee5

Copy link
Copy Markdown
Author

Follow-up from a review of this change: LogRecordReadContext.close() currently nulls allocator references in finally even when close fails, and it closes the unshaded allocator outside unshadedArrowResourceLock. Tracked in #4351.

Close the unshaded allocator under its lock, and only drop
references after a successful close so a later close() can
still release leftover native memory.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

[client] LogFetcher close chain leaks Arrow memory when close fails mid-chain

1 participant