yanghua commented on a change in pull request #7571: [FLINK-10724] Refactor 
failure handling in check point coordinator
URL: https://github.com/apache/flink/pull/7571#discussion_r251381275
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java
 ##########
 @@ -1277,6 +1284,37 @@ private void discardCheckpoint(PendingCheckpoint 
pendingCheckpoint, @Nullable Th
                }
        }
 
+       private void tryHandleCheckpointException(DeclineCheckpoint message, 
PendingCheckpoint currentCheckpoint) {
+               boolean needFailJob = message.getReason() != null && 
!(message.getReason() instanceof CheckpointDeclineException)
+                       && failOnCheckpointingErrors && 
!currentCheckpoint.getProps().isSavepoint();
+
+               if (needFailJob) {
+                       boolean processed = false;
+                       ExecutionAttemptID failedExecutionID = 
message.getTaskExecutionId();
+                       for (ExecutionVertex vertex : tasksToWaitFor) {
+                               if 
(vertex.getCurrentExecutionAttempt().getAttemptId().equals(failedExecutionID)) {
+                                       if (currentPeriodicTrigger != null) {
+                                               
currentPeriodicTrigger.cancel(true);
+                                               currentPeriodicTrigger = null;
+                                       }
+
+                                       vertex.fail(message.getReason());
+                                       processed = true;
+                                       break;
+                               }
+                       }
+
+                       if (!processed) {
 
 Review comment:
   I believe that you are right in most cases, but there is a possibility that 
the network has a very serious delay. At this time, the job has failed over, 
and the attempt id has changed. Although this is unlikely, it is a defensive 
programming mechanism.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to