ifndef-SleePy commented on a change in pull request #9853:
[FLINK-13904][checkpointing] Avoid competition of checkpoint triggering
URL: https://github.com/apache/flink/pull/9853#discussion_r335801615
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java
##########
@@ -1306,10 +1312,8 @@ private long getRandomInitDelay() {
return
ThreadLocalRandom.current().nextLong(minPauseBetweenCheckpoints, baseInterval +
1L);
}
- private ScheduledFuture<?> scheduleTriggerWithDelay(long initDelay) {
- return timer.scheduleAtFixedRate(
- new ScheduledTrigger(),
- initDelay, baseInterval, TimeUnit.MILLISECONDS);
+ private ScheduledFuture<?> scheduleTriggerWithDelay(long delay) {
+ return timer.schedule(new ScheduledTrigger(), delay,
TimeUnit.MILLISECONDS);
Review comment:
That's a good question. The direct reason is that currently the main thread
executor does not support periodic scheduling, it's not implemented yet. So
there are two options.
1. Support periodic scheduling in main thread executor.
2. Manually triggering checkpoint in `CheckpointCoordinator`.
There is a short discussion of the option 1, see
https://issues.apache.org/jira/browse/FLINK-13848.
I choose option 2 currently. Because I'm a not fan of the way of periodic
scheduling currently. There are a lot of cancellation of periodic scheduling.
Cancellation is not accurate and reliable somewhat.
But to be honest, there is a short-coming of option 2. We have to make sure
the next trigger will be scheduled under all scenarios, successful, failed,
request queued (it's messy of handling queued request now). It's a bit
complicated than I expected.
Do you have any suggestion of this?
----------------------------------------------------------------
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