Skip to content

Commit 311808c

Browse files
committed
[review] Adds proper comment to reason about the increment in the default value formula of MAXIMUM_DELAY_FOR_SCALE_TRIGGER
1 parent d2256c3 commit 311808c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptive/AdaptiveScheduler.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,17 @@ public static Settings of(
243243
&& checkpointingConfiguration
244244
.getCheckpointCoordinatorConfiguration()
245245
.isCheckpointingEnabled()
246+
// incrementing the rescaleOnFailedCheckpointsCount by 1 is done to
247+
// avoid introducing a race-condition between the two parameters
248+
// (SCHEDULER_SCALE_ON_FAILED_CHECKPOINTS_COUNT and
249+
// MAXIMUM_DELAY_FOR_SCALE_TRIGGER). Without the increment, we would
250+
// have two configuration parameters that result in roughly the same
251+
// timeout (with the MAXIMUM_DELAY_FOR_SCALE_TRIGGER being probably a
252+
// bit faster). The user might experience unexpected behavior if the
253+
// SCHEDULER_SCALE_ON_FAILED_CHECKPOINTS_COUNT is configured and
254+
// MAXIMUM_DELAY_FOR_SCALE_TRIGGER is kept untouched in that case.
255+
// Incrementing the default value should help avoiding causing this kind
256+
// of confusing race condition.
246257
? Duration.ofMillis(
247258
(rescaleOnFailedCheckpointsCount + 1)
248259
* checkpointingConfiguration

0 commit comments

Comments
 (0)