Github user tillrohrmann commented on a diff in the pull request:
https://github.com/apache/flink/pull/5239#discussion_r165317571
--- Diff:
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamTask.java
---
@@ -916,57 +916,78 @@ private void handleExecutionException(Exception e) {
CheckpointingOperation.AsynCheckpointState.COMPLETED,
CheckpointingOperation.AsynCheckpointState.RUNNING);
- try {
- cleanup();
- } catch (Exception cleanupException) {
- e.addSuppressed(cleanupException);
- }
+ if (asyncCheckpointState.compareAndSet(
+
CheckpointingOperation.AsynCheckpointState.RUNNING,
+
CheckpointingOperation.AsynCheckpointState.DISCARDED)) {
--- End diff --
This could be
`asyncCheckpointState.compareAndSet(currentAsyncCheckpointState, DISCARDED)`.
Then we could remove the compare and set above this if condition.
---