yigress commented on code in PR #23425:
URL: https://github.com/apache/flink/pull/23425#discussion_r1364762331


##########
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointsCleaner.java:
##########
@@ -71,10 +70,26 @@ public void cleanCheckpoint(
             boolean shouldDiscard,
             Runnable postCleanAction,
             Executor executor) {
-        Checkpoint.DiscardObject discardObject =
-                shouldDiscard ? checkpoint.markAsDiscarded() : 
Checkpoint.NOOP_DISCARD_OBJECT;
-
-        cleanup(checkpoint, discardObject::discard, postCleanAction, executor);
+        if (shouldDiscard) {
+            incrementNumberOfCheckpointsToClean();
+            checkpoint
+                    .markAsDiscarded()
+                    .discardAsync(executor)
+                    .handle(
+                            (Object outerIgnored, Throwable outerThrowable) -> 
{
+                                if (outerThrowable != null) {
+                                    LOG.warn(
+                                            "Could not properly discard 
completed checkpoint {}.",
+                                            checkpoint.getCheckpointID(),
+                                            outerThrowable);
+                                }
+                                decrementNumberOfCheckpointsToClean();

Review Comment:
   i think the confusion is from that I moved the 
incrementNumberOfCheckpointsToClean() to only shouldDiscard=true. so when 
shouldDiscard=false, there is no increment, thus no decrement as well. Or I am 
seriously missing something?



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

To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to