hudi-agent commented on code in PR #20023:
URL: https://github.com/apache/hudi/pull/20023#discussion_r4071526823


##########
hudi-common/src/main/java/org/apache/hudi/common/table/read/lsm/SpillableLsmRecordIterator.java:
##########
@@ -166,6 +167,9 @@ private void 
closeSourceIterator(ClosableIterator<BufferedRecord<T>> sourceItera
       if (spillFailure != null) {
         spillFailure.addSuppressed(e);
       } else {
+        // Closing the source iterator failed, so construction cannot complete 
and the outer reader
+        // cannot call close() on this spill iterator. Delete its spill file 
here to avoid leaking it.
+        CloseableUtils.closeSuppressing(this::deleteSpillFile, e);

Review Comment:
   🤖 The cleanup only runs for `RuntimeException` — if `sourceIterator.close()` 
throws an `Error` (or any other `Throwable`), the spill file still leaks the 
same way. Would it be worth widening this catch to `Throwable` (rethrowing 
after cleanup) so the fix covers that path too?
   
   <sub><i>⚠️ AI-generated; verify before applying. React 👍/👎 to flag 
quality.</i></sub>



-- 
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]

Reply via email to