akalash commented on code in PR #21923: URL: https://github.com/apache/flink/pull/21923#discussion_r1113358376
########## flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamTask.java: ########## @@ -949,7 +952,9 @@ public final void cleanUp(Throwable throwable) throws Exception { // disabled the interruptions or not. getCompletionFuture().exceptionally(unused -> null).join(); // clean up everything we initialized - isRunning = false; + if (!isCanceled() && !isFailing()) { Review Comment: I think that highly likely we can have FSM for this logic but I agree that it requires more research about its correctness. So if we want to keep this ticket simple and save the logic that we have now. We can not have `failing` in the enum because we can have `failing` and `running` at the same time. Maybe we should have `TaskState` object with enum and `failing` flag inside. It doesn't look as clean as the solution in this PR but at least it is cleaner than the current one and it keeps the same logic. -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org