QuakeWang opened a new pull request, #8144: URL: https://github.com/apache/paimon/pull/8144
### Purpose `MosaicReaderFactory` creates a `MosaicInputFileAdapter` before constructing `MosaicRecordsReader`. If `MosaicRecordsReader` failed during construction, callers could not receive the reader instance and therefore could not close it. The old constructor only closed the allocator when `MosaicReader.open` threw an `Exception`. It did not close the input adapter, did not handle `Error` failures such as native loading errors, and did not clean up if initialization failed after the native reader had already been created. This patch initializes reader resources through local variables and assigns final fields only after construction succeeds. On construction failure, it closes the created native reader, allocator, and input adapter while preserving the original exception. ### Tests - `mvn -pl paimon-mosaic -am -Pfast-build -DfailIfNoTests=false -Dtest=MosaicRecordsReaderTest test` - `mvn -pl paimon-mosaic -am -DfailIfNoTests=false -Dtest=MosaicRecordsReaderTest test` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
