Skip to content

test(parquet): allocate raw Arrow reader buffers from the default pool - #386

Merged
lxy-9602 merged 1 commit into
apache:mainfrom
SteNicholas:PAIMON-385
Sep 24, 2026
Merged

lxy-9602 merged 1 commit into
apache:mainfrom
SteNicholas:PAIMON-385

Conversation

@SteNicholas

@SteNicholas SteNicholas commented Sep 23, 2026

Copy link
Copy Markdown
Member

Purpose

Linked issue: close #385

Several Parquet tests open files directly with arrow::io::ReadableFile and parquet::arrow::OpenFile, passing a raw pointer to the fixture's GetArrowPool() adaptor. Pre-buffering is enabled by default, so an Arrow IO thread can drop the last reference to a read buffer after the fixture has been torn down. ~PoolBuffer() then frees into the destroyed pool and paimon-parquet-format-test crashes with SIGSEGV, as seen in VariantParquetTest.

This PR switches these raw readers to arrow::default_memory_pool(), which outlives any in-flight async read. It also adds the error status to the ReadableFile::Open assertion messages so that failures show why the open failed.

Paimon's own read path is unaffected: ArrowInputStreamAdapter already keeps its pool alive for returned buffers.

Tests

Test-only change in:

  • src/paimon/format/parquet/parquet_file_batch_reader_test.cpp
  • src/paimon/format/parquet/parquet_format_writer_test.cpp
  • src/paimon/format/parquet/variant_parquet_test.cpp

API and Format

No.

Documentation

No.

Generative AI tooling

Generated-by: Claude Code (Claude Opus 5.5)

🤖 Generated with Claude Code

Several Parquet tests open files with arrow::io::ReadableFile and
parquet::arrow::OpenFile, passing a raw pointer to the fixture's
GetArrowPool() adaptor. Pre-buffering is enabled by default, so an Arrow
IO thread can drop the last reference to a read buffer after the fixture
has been torn down. ~PoolBuffer() then frees into the destroyed pool and
paimon-parquet-format-test crashes with SIGSEGV, as seen in
VariantParquetTest.

Use arrow::default_memory_pool() for these raw readers so the pool
outlives any in-flight async read. Paimon's own read path is unaffected:
ArrowInputStreamAdapter already keeps its pool alive for returned
buffers.

@lxy-9602 lxy-9602 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@lxy-9602
lxy-9602 merged commit 99f8bf0 into apache:main Sep 24, 2026
16 checks passed
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.

[Bug] Flaky SIGSEGV in VariantParquetTest: Arrow IO thread frees PoolBuffer after the test's memory pool is destroyed

2 participants