Repository navigation
GH-238: Stop TestNettyAllocator wrapping Netty's empty buffer in a 1024-byte ArrowBuf - #1427
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's Changed
TestNettyAllocator.testMemoryUsagewrapped a 1024-byteNO_OPArrowBufaround the memory address ofPooledByteBufAllocatorL's empty buffer, whose native allocation is only a few bytes. The test only readsmemoryAddress()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 inTestEmptyArrowBuf.The buffer isn't needed. The memory usage log the test waits for comes from the status thread that the
PooledByteBufAllocatorLconstructor starts when TRACE logging is enabled, so the test now constructs the allocator directly and drops theArrowBuf.All
memory-nettytests pass locally on JDK 21 with Error Prone enabled.Closes #238.