Repository navigation
GH-1455: Keep TestReservationListener from closing a pool still in use - #1457
Merged
jbonofre merged 1 commit intoNov 10, 2026
Merged
Conversation
… in use testErrorThrownFromReservationListener closed its listenable NativeMemoryPool right after the scan failed. Arrow C++ can still be running the failed scan's work on its thread pools, and that work keeps using the pool, so freeing it could crash the test JVM. Leave the pool open in that test, and close the scanner and dataset in collectResultFromFactory when the scan fails.
lidavidm
approved these changes
Nov 9, 2026
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
TestReservationListener#testErrorThrownFromReservationListenercloses its listenableNativeMemoryPoolright after the scan fails. Arrow C++ can still be running the failed scan's work (Parquet file opens, read-ahead) on its thread pools, and that work keeps allocating from and freeing to the pool. Freeing the pool under it intermittently crashes the test JVM in the RC workflow's Binaries job, and surefire reportsTestAllTypes, the next test in that JVM, as the crashed test. #1455 has the analysis.testErrorThrownFromReservationListenerleaves the pool open, with a comment explaining why. The assertion on the reservation after closing the pool is removed; the one before it stays.TestDataset#collectResultFromFactorycloses the scanner and the dataset when the scan fails, not only when it succeeds. This alone doesn't stop the crash, because closing the scanner doesn't wait for that work.I looped the test's steps up to 1,000 times per JVM on macOS arm64 with the
jni-macos-aarch_64libraries from the RC workflow. With the pool closed, 11 of 14 runs failed (JVM crash, or a scan that should have failed succeeded), whether or not the scanner was closed first. With the pool left open, 10 of 10 runs passed. With this change,TestReservationListenerpassed in 8 of 8 runs, and the other tests that usecollectResultFromFactorypass (TestFileSystemDataset,TestAllTypes). I skippedTestFileSystemDataset#testBaseJsonRead, which crashes with the macOS library for an unrelated reason (#1429).This doesn't fix the library problem that a listenable pool can be freed while native scan work still uses it. I've described that in #246.
Closes #1455.