GJL commented on a change in pull request #9240: [FLINK-13440] Add test that 
fails job when in-flight sync savepoint is discarded.
URL: https://github.com/apache/flink/pull/9240#discussion_r308229572
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointFailureReason.java
 ##########
 @@ -23,60 +23,69 @@
  */
 public enum CheckpointFailureReason {
 
-       PERIODIC_SCHEDULER_SHUTDOWN("Periodic checkpoint scheduler is shut 
down."),
+       PERIODIC_SCHEDULER_SHUTDOWN(true, "Periodic checkpoint scheduler is 
shut down."),
 
-       ALREADY_QUEUED("Another checkpoint request has already been queued."),
+       ALREADY_QUEUED(true, "Another checkpoint request has already been 
queued."),
 
-       TOO_MANY_CONCURRENT_CHECKPOINTS("The maximum number of concurrent 
checkpoints is exceeded"),
+       TOO_MANY_CONCURRENT_CHECKPOINTS(true, "The maximum number of concurrent 
checkpoints is exceeded"),
 
-       MINIMUM_TIME_BETWEEN_CHECKPOINTS("The minimum time between checkpoints 
is still pending. " +
+       MINIMUM_TIME_BETWEEN_CHECKPOINTS(true, "The minimum time between 
checkpoints is still pending. " +
                        "Checkpoint will be triggered after the minimum time."),
 
-       NOT_ALL_REQUIRED_TASKS_RUNNING("Not all required tasks are currently 
running."),
+       NOT_ALL_REQUIRED_TASKS_RUNNING(true, "Not all required tasks are 
currently running."),
 
-       EXCEPTION("An Exception occurred while triggering the checkpoint."),
+       EXCEPTION(true, "An Exception occurred while triggering the 
checkpoint."),
 
-       CHECKPOINT_EXPIRED("Checkpoint expired before completing."),
+       CHECKPOINT_EXPIRED(false, "Checkpoint expired before completing."),
 
-       CHECKPOINT_SUBSUMED("Checkpoint has been subsumed."),
+       CHECKPOINT_SUBSUMED(false, "Checkpoint has been subsumed."),
 
-       CHECKPOINT_DECLINED("Checkpoint was declined."),
+       CHECKPOINT_DECLINED(false, "Checkpoint was declined."),
 
-       CHECKPOINT_DECLINED_TASK_NOT_READY("Checkpoint was declined (tasks not 
ready)"),
+       CHECKPOINT_DECLINED_TASK_NOT_READY(false, "Checkpoint was declined 
(tasks not ready)"),
 
-       CHECKPOINT_DECLINED_TASK_NOT_CHECKPOINTING("Task does not support 
checkpointing"),
+       CHECKPOINT_DECLINED_TASK_NOT_CHECKPOINTING(false, "Task does not 
support checkpointing"),
 
-       CHECKPOINT_DECLINED_SUBSUMED("Checkpoint was canceled because a barrier 
from newer checkpoint was received."),
+       CHECKPOINT_DECLINED_SUBSUMED(false, "Checkpoint was canceled because a 
barrier from newer checkpoint was received."),
 
-       CHECKPOINT_DECLINED_ON_CANCELLATION_BARRIER("Task received cancellation 
from one of its inputs"),
+       CHECKPOINT_DECLINED_ON_CANCELLATION_BARRIER(false, "Task received 
cancellation from one of its inputs"),
 
-       CHECKPOINT_DECLINED_ALIGNMENT_LIMIT_EXCEEDED("The checkpoint alignment 
phase needed to buffer more than the configured maximum bytes"),
+       CHECKPOINT_DECLINED_ALIGNMENT_LIMIT_EXCEEDED(false, "The checkpoint 
alignment phase needed to buffer more than the configured maximum bytes"),
 
-       CHECKPOINT_DECLINED_INPUT_END_OF_STREAM("Checkpoint was declined 
because one input stream is finished"),
+       CHECKPOINT_DECLINED_INPUT_END_OF_STREAM(false, "Checkpoint was declined 
because one input stream is finished"),
 
-       CHECKPOINT_COORDINATOR_SHUTDOWN("CheckpointCoordinator shutdown."),
+       CHECKPOINT_COORDINATOR_SHUTDOWN(false, "CheckpointCoordinator 
shutdown."),
 
-       CHECKPOINT_COORDINATOR_SUSPEND("Checkpoint Coordinator is suspending."),
+       CHECKPOINT_COORDINATOR_SUSPEND(false, "Checkpoint Coordinator is 
suspending."),
 
-       JOB_FAILURE("The job has failed."),
+       JOB_FAILURE(false, "The job has failed."),
 
-       JOB_FAILOVER_REGION("FailoverRegion is restarting."),
+       JOB_FAILOVER_REGION(false, "FailoverRegion is restarting."),
 
-       TASK_CHECKPOINT_FAILURE("Task local checkpoint failure."),
+       TASK_CHECKPOINT_FAILURE(false, "Task local checkpoint failure."),
 
-       FINALIZE_CHECKPOINT_FAILURE("Failure to finalize checkpoint."),
+       FINALIZE_CHECKPOINT_FAILURE(false, "Failure to finalize checkpoint."),
 
-       TRIGGER_CHECKPOINT_FAILURE("Trigger checkpoint failure.");
+       TRIGGER_CHECKPOINT_FAILURE(false, "Trigger checkpoint failure.");
 
        // 
------------------------------------------------------------------------
 
+       private final boolean isPreFlight;
        private final String message;
 
-       CheckpointFailureReason(String message) {
+       CheckpointFailureReason(boolean isPreFlight, String message) {
+               this.isPreFlight = isPreFlight;
                this.message = message;
        }
 
        public String message() {
                return message;
        }
+
+       /**
+        * @return true if this value indicates a failure reason happening 
before a checkpoint is passed to a job's tasks.
+        */
+       public boolean isPreFlight() {
+               return isPreFlight;
 
 Review comment:
   consider renaming the field to `preFlight`: 
https://stackoverflow.com/questions/5322648/for-a-boolean-field-what-is-the-naming-convention-for-its-getter-setter

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


With regards,
Apache Git Services

Reply via email to