danny0405 commented on code in PR #19482:
URL: https://github.com/apache/hudi/pull/19482#discussion_r3708856959
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/format/cdc/CdcIterators.java:
##########
@@ -347,8 +347,9 @@ public RowData next() {
@Override
public void close() {
- logRecordIterator.close();
- imageManager.close();
+ try (CdcImageManager ignored = imageManager) {
+ logRecordIterator.close();
+ }
}
Review Comment:
Correction in 311709c962d5: after tracing split construction, the earlier
ownership explanation was wrong. Each CdcInputSplit is scoped to one file
group, and same-instant LOG_FILE splits are ordered by before-slice depth.
Mutating the cached image intentionally advances it for the next split and
avoids reloading. DataLogFileIterator now closes only its log iterator;
CdcFileSplitsIterator owns and closes the shared manager once, with
try-with-resources preserving the iterator failure and suppressing a
manager-close failure. Added tests that verify the manager remains open across
child transitions and is closed exactly once at the outer boundary.
--
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]