cshuo opened a new pull request, #20023: URL: https://github.com/apache/hudi/pull/20023
### Describe the issue this Pull Request addresses Closes #20022. When spilling succeeds but the source iterator's `close()` throws, `SpillableLsmRecordIterator` construction fails without deleting its spill file. The outer reader never receives the iterator and cannot close it to release that file. ### Summary and Changelog - Delete the completed spill file when source closure fails after a successful spill. - Preserve the source-close exception and attach a spill-file deletion failure as a suppressed exception. - Cover empty and non-empty spills and the case where source closure and spill-file deletion both fail. Validation: `TestSpillableLsmRecordIterator` (7 tests) and `TestLsmFileGroupRecordIterator` (5 tests) passed, along with Checkstyle and Apache RAT checks. Ran from the repository root with `mvn -pl hudi-common -am -Dtest=TestSpillableLsmRecordIterator,TestLsmFileGroupRecordIterator -Dsurefire.failIfNoSpecifiedTests=false -DskipITs -DskipSparkTests -DskipScalaTests test`; Mockito was loaded as a startup Java agent to avoid the local environment's dynamic-attach limitation. ### Impact Prevents orphaned local LSM spill files on the source-close failure path. Successful reads, storage format, public APIs, and configuration remain unchanged. ### Risk Level Low. The change is limited to cleanup after a failed constructor; targeted tests verify deletion and exception preservation. ### Documentation Update None. ### Contributor's checklist - [ ] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute) - [x] Enough context is provided in the sections above - [x] Adequate tests were added if applicable -- 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]
