echauchot commented on code in PR #22985: URL: https://github.com/apache/flink/pull/22985#discussion_r1360310094
########## flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptive/Executing.java: ########## @@ -67,13 +77,33 @@ class Executing extends StateWithExecutionGraph implements ResourceListener { this.context = context; Preconditions.checkState( executionGraph.getState() == JobStatus.RUNNING, "Assuming running execution graph"); + this.scalingIntervalMin = scalingIntervalMin; + this.scalingIntervalMax = scalingIntervalMax; + Preconditions.checkState( + !scalingIntervalMin.isNegative(), + "{} must be positive integer or 0", + JobManagerOptions.SCHEDULER_SCALING_INTERVAL_MIN.key()); + if (scalingIntervalMax != null) { + Preconditions.checkState( + scalingIntervalMax.compareTo(scalingIntervalMin) > 0, + "{}({}) must be greater than {}({})", + JobManagerOptions.SCHEDULER_SCALING_INTERVAL_MAX.key(), + scalingIntervalMax, + JobManagerOptions.SCHEDULER_SCALING_INTERVAL_MIN.key(), + scalingIntervalMin); + } deploy(); // check if new resources have come available in the meantime context.runIfState(this, this::maybeRescale, Duration.ZERO); Review Comment: when the Executing is initially created (without any restart) meaning when the job transitions from Creating to Executing, what is the point in waiting the cooldown period ? In the case of a restart, the scalingIntervalMin is respected because the triggering of the restart (maybeRescale) was not called before scalingIntervalMin during the life of the pipeline. Then there is no point in waiting again when we recreate the Executing object (we have already waited before the restart). -- 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