pnowojski commented on a change in pull request #10332: 
[FLINK-13905][checkpointing] Separate checkpoint triggering into several 
asynchronous stages
URL: https://github.com/apache/flink/pull/10332#discussion_r366429570
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java
 ##########
 @@ -708,22 +689,33 @@ public void receiveDeclineMessage(DeclineCheckpoint 
message, String taskManagerL
                                return;
                        }
 
-                       checkpoint = pendingCheckpoints.remove(checkpointId);
+                       checkpoint = pendingCheckpoints.get(checkpointId);
 
-                       if (checkpoint != null && !checkpoint.isDiscarded()) {
+                       if (checkpoint != null) {
+                               Preconditions.checkState(
+                                       !checkpoint.isDiscarded(),
+                                       "Received message for discarded but 
non-removed checkpoint " + checkpointId);
                                LOG.info("Decline checkpoint {} by task {} of 
job {} at {}.",
                                        checkpointId,
                                        message.getTaskExecutionId(),
                                        job,
                                        taskManagerLocationInfo);
-                               discardCheckpoint(checkpoint, 
message.getReason(), message.getTaskExecutionId());
-                       }
-                       else if (checkpoint != null) {
-                               // this should not happen
-                               throw new IllegalStateException(
-                                               "Received message for discarded 
but non-removed checkpoint " + checkpointId);
-                       }
-                       else if (LOG.isDebugEnabled()) {
+                               final CheckpointException checkpointException;
+                               if (message.getReason() == null) {
+                                       checkpointException =
+                                               new 
CheckpointException(CheckpointFailureReason.CHECKPOINT_DECLINED);
+                               } else if (message.getReason() instanceof 
CheckpointException) {
+                                       checkpointException = 
(CheckpointException) message.getReason();
+                               } else {
+                                       checkpointException =
+                                               new CheckpointException(
+                                                       
CheckpointFailureReason.JOB_FAILURE, message.getReason());
+                               }
 
 Review comment:
   Has this happened? I can not find this fixed in the the last `[hotfix] 
Address review comments.` nor it's fixed in this commit.
   
   Btw, having one commit with all of the addressed comments, where comments 
were referring to multiple commits is not the best solution. Since you would 
have to fixup the correct commits before merging, it would be better to have 
couple of smaller fixup commits (one fixup commit per original commit). (Also 
FYI, I would be fine with you already squashing the fixup commits with the 
original commits)

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