rkhachatryan commented on a change in pull request #12670:
URL: https://github.com/apache/flink/pull/12670#discussion_r440963669



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointFailureManager.java
##########
@@ -81,22 +78,24 @@ public void handleTaskLevelCheckpointException(
                        CheckpointException exception,
                        long checkpointId,
                        ExecutionAttemptID executionAttemptID) {
-               checkFailureCounter(exception, checkpointId);
-               if (continuousFailureCounter.get() > tolerableCpFailureNumber) {
+               handleException(exception, checkpointId, (failureCallback, e) 
-> failureCallback.failJobDueToTaskFailure(e, executionAttemptID));
+       }
+
+       private void handleException(CheckpointException exception, long 
checkpointId, BiConsumer<FailJobCallback, Exception> onFailure) {
+               if (isFailure(exception) &&
+                               countedCheckpointIds.add(checkpointId) &&
+                               continuousFailureCounter.incrementAndGet() > 
tolerableCpFailureNumber) {
                        clearCount();
-                       failureCallback.failJobDueToTaskFailure(new 
FlinkRuntimeException("Exceeded checkpoint tolerable failure threshold."), 
executionAttemptID);
+                       onFailure.accept(failureCallback, new 
FlinkRuntimeException("Exceeded checkpoint tolerable failure threshold."));
                }
        }
 
-       public void checkFailureCounter(
-                       CheckpointException exception,
-                       long checkpointId) {
+       private boolean isFailure(CheckpointException exception) {

Review comment:
       Addressed in #12686




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to