Efrat19 commented on code in PR #27375:
URL: https://github.com/apache/flink/pull/27375#discussion_r3383175865
##########
flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java:
##########
@@ -1011,6 +1024,15 @@ private void releaseResources() {
}
closeAllResultPartitions();
closeAllInputGates();
+ if (this.channelStateWriter != null) {
+ LOG.debug("Closing channelStateWriter for task {}",
taskNameWithSubtask);
+ try {
+ this.channelStateWriter.close();
+ } catch (IOException e) {
+ LOG.error(
+ "Failed to close channelStateWriter for task {}.",
taskNameWithSubtask, e);
+ }
Review Comment:
thanks, fixed
##########
flink-runtime/src/test/java/org/apache/flink/runtime/taskmanager/TaskTest.java:
##########
@@ -1762,4 +1792,35 @@ void awaitTriggerLatch() {
}
}
}
+
+ private static class ChannelStateWriterWithCloseTracker
+ extends ChannelStateWriter.NoOpChannelStateWriter {
+ private final AtomicBoolean closeCalled = new AtomicBoolean(false);
+
+ @Override
+ public void close() {
+ closeCalled.set(true);
+ ;
Review Comment:
thanks, fixed
##########
flink-runtime/src/test/java/org/apache/flink/runtime/taskmanager/TaskTest.java:
##########
@@ -1762,4 +1791,38 @@ void awaitTriggerLatch() {
}
}
}
+
+ private static class ChannelStateWriterWithCloseCounter
+ extends ChannelStateWriter.NoOpChannelStateWriter {
+ private final AtomicInteger closeCalledCounter = new AtomicInteger(0);
+
+ @Override
+ public void close() {
+ closeCalledCounter.incrementAndGet();
+ }
+
+ public boolean isOpen() {
+ return closeCalledCounter.get() == 0;
+ }
+
+ public boolean isClosed() {
+ return closeCalledCounter.get() == 1;
Review Comment:
thanks, fixed
--
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]