pgaref commented on code in PR #21923: URL: https://github.com/apache/flink/pull/21923#discussion_r1113686245
########## 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: Thanks all for the comments, I have been thinking about a State machine all along, just didnt want to introduce too many changes on such a fundamental class. @pnowojski `canceled` and `running` can never be true at the same time because of: https://github.com/apache/flink/pull/21923/files#diff-0c5fe245445b932fa83fdaf5c4802dbe671b73e8d76f39058c6eaaaffd9639faL977-L978 However, we can not make the same assumption for `failing` and `running` as @akalash mentioned. I have added the transitions to cover the Task lifecycle in the latest commit but I am leaning towards adding the failing flag as part of the TaskState to keep the logic closer to the existing. -- 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