Skip to content

GH-238: Stop TestNettyAllocator wrapping Netty's empty buffer in a 1024-byte ArrowBuf - #1427

Merged
jbonofre merged 1 commit into
apache:mainfrom
jbonofre:test-netty-allocator-empty-buf
Nov 1, 2026
Merged

jbonofre merged 1 commit into
apache:mainfrom
jbonofre:test-netty-allocator-empty-buf

Conversation

@jbonofre

@jbonofre jbonofre commented Nov 1, 2026

Copy link
Copy Markdown
Member

What's Changed

TestNettyAllocator.testMemoryUsage wrapped a 1024-byte NO_OP ArrowBuf around the memory address of PooledByteBufAllocatorL's empty buffer, whose native allocation is only a few bytes. The test only reads memoryAddress() today, so nothing overruns yet, but any read or write through that buffer would run past the end of the native allocation. That's the same problem #1426 fixes in TestEmptyArrowBuf.

The buffer isn't needed. The memory usage log the test waits for comes from the status thread that the PooledByteBufAllocatorL constructor starts when TRACE logging is enabled, so the test now constructs the allocator directly and drops the ArrowBuf.

All memory-netty tests pass locally on JDK 21 with Error Prone enabled.

Closes #238.

…n a 1024-byte ArrowBuf

TestNettyAllocator.testMemoryUsage wrapped a 1024-byte NO_OP ArrowBuf around
the memory address of PooledByteBufAllocatorL's empty buffer, whose native
allocation is only a few bytes. The test only reads the address today, but
any read or write through that buffer would run past the end of the native
allocation, as in TestEmptyArrowBuf (apache#1426).

The buffer isn't needed: the memory usage log the test waits for comes from
the status thread that the PooledByteBufAllocatorL constructor starts when
TRACE logging is enabled. Construct the allocator directly instead.

Closes apache#238.
@jbonofre jbonofre added the bug-fix PRs that fix a big. label Nov 1, 2026
@github-actions github-actions Bot added this to the 20.0.0 milestone Nov 1, 2026
@jbonofre
jbonofre merged commit aaf68b4 into apache:main Nov 1, 2026
21 of 23 checks passed
@jbonofre
jbonofre deleted the test-netty-allocator-empty-buf branch November 1, 2026 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix PRs that fix a big.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Java][Windows] Intermittent failure to run unit test (failed: Error occurred in starting fork)

1 participant