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

未关闭 适合新手
#4,353 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

@EchoLee5 已经在做这个了。

开始于 2026年9月16日。

  • #4356 来自 @EchoLee5 —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
java
领域
database

调研方向

从 fluss-client 中 LimitBatchScanner 的实现里的 parseLimitScanResponse() 开始,重点关注调用 LogRecordReadContext.createReadContext() 的日志表路径。确保 read context 在解析完成后以及解析失败时都能关闭;完成的标准是 LIMIT 扫描在 scanner 关闭之前释放 Arrow allocator。

由索引模型根据 Issue 内容生成。

描述

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

主要语言
Java
星标
2.2k
派生
668
平均合并
3 天 4 小时
30 天内合并 PR
146

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/fluss 的其他 Issue

查看 apache/fluss 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。