1996fanrui commented on code in PR #29065:
URL: https://github.com/apache/flink/pull/29065#discussion_r3928554801
##########
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/channel/SequentialChannelStateReaderImpl.java:
##########
@@ -102,7 +104,16 @@ public Optional<FetchedChannelState> readInputData(
}
// stateHandler.close() (above) has flushed the filter writer and
published the
// produced spill file, so read getProducedChannelState() after
the close completes.
- return Optional.ofNullable(stateHandler.getProducedChannelState());
+ Optional<FetchedChannelState> produced =
+
Optional.ofNullable(stateHandler.getProducedChannelState());
+ published = true;
+ return produced;
+ } finally {
+ // On abort no drainer is built to release the produced state;
close it here (quietly,
+ // so it doesn't mask the original failure) to avoid orphaning its
spill files.
+ if (!published) {
+ IOUtils.closeQuietly(stateHandler.getProducedChannelState());
+ }
Review Comment:
Done — the spilling handler now takes the CloseableRegistry and registers
its spill files itself, covering both.
--
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]