Skip to content

[client] LimitBatchScanner leaks Arrow read context on log-table LIMIT scan #4353

Open

Description

@EchoLee5

Description

LimitBatchScanner.parseLimitScanResponse() creates a LogRecordReadContext for log tables (no primary key) and never closes it.

For Arrow log format, LogRecordReadContext.createReadContext() allocates a RootAllocator backed by the scanner's ChunkedFactory. The record iterator is closed, and rows are deep-copied, but the read context itself is left open. LimitBatchScanner.close() only closes chunkedFactory, so the allocator and its off-heap chunks can leak on every LIMIT scan of an Arrow log table.

LogRecordReadContext readContext =
        LogRecordReadContext.createReadContext(...);
// iterated, then dropped without readContext.close()

This is a different path from #4345 (LogFetcher / LogScannerImpl close chain).

Expected

LogRecordReadContext is closed after parsing (including on parse failure), so Arrow allocators are released before the scanner is closed.

How to reproduce

  1. Create an Arrow log table (no primary key).
  2. Run a LIMIT scan / LimitBatchScanner.pollBatch().
  3. Close the scanner. The read-context allocator is never closed.

Component

fluss-client — LimitBatchScanner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions