Samrat002 commented on code in PR #27921:
URL: https://github.com/apache/flink/pull/27921#discussion_r3135389690


##########
flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptive/Executing.java:
##########
@@ -182,6 +187,74 @@ public ScheduledFuture<?> scheduleOperation(Runnable 
callback, Duration delay) {
         return context.runIfState(this, callback, delay);
     }
 
+    private static final Duration ACTIVE_CHECKPOINT_RETRY_DELAY = 
Duration.ofSeconds(10);
+
+    @Override
+    public void requestActiveCheckpointTrigger() {
+        if (!activeCheckpointTriggerEnabled) {
+            return;
+        }
+
+        final CheckpointCoordinator checkpointCoordinator =
+                getExecutionGraph().getCheckpointCoordinator();
+
+        if (checkpointCoordinator == null
+                || !checkpointCoordinator.isPeriodicCheckpointingConfigured()) 
{
+            getLogger()
+                    .debug(
+                            "Skipping active checkpoint trigger for rescale: 
checkpointing not configured.");
+            return;
+        }
+
+        if (!parallelismChanged()) {
+            getLogger()
+                    .debug(
+                            "Skipping active checkpoint trigger for rescale: 
parallelism unchanged.");
+            return;
+        }
+
+        if (checkpointCoordinator.getNumberOfPendingCheckpoints() > 0
+                || checkpointCoordinator.isTriggering()) {
+            getLogger()
+                    .debug(
+                            "Skipping active checkpoint trigger for rescale: 
checkpoint already in progress.");
+            return;
+        }
+
+        if (!checkpointCoordinator.isMinPauseBetweenCheckpointsSatisfied()) {
+            getLogger()
+                    .debug(
+                            "Skipping active checkpoint trigger for rescale: 
min pause between checkpoints not satisfied, scheduling retry.");
+            context.runIfState(

Review Comment:
   i have added guard around minPause time calculation. The caller now 
schedules the retry for exactly remainingMinPause milliseconds. Thanks for 
pointing this out!



-- 
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: [email protected]

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

Reply via email to