rkhachatryan commented on a change in pull request #15146:
URL: https://github.com/apache/flink/pull/15146#discussion_r592486365



##########
File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/checkpointing/AlternatingController.java
##########
@@ -188,12 +266,12 @@ private boolean canTimeout(CheckpointBarrier barrier) {
         return barrier.getCheckpointOptions().isTimeoutable()
                 && barrier.getId() <= lastSeenBarrier
                 && barrier.getCheckpointOptions().getAlignmentTimeout() * 
1_000_000
-                        < (System.nanoTime() - firstBarrierArrivalTime);
+                        < (clock.relativeTimeNanos() - lastBarrierArrivalTime);
     }
 
-    private long getArrivalTime(CheckpointBarrier announcedBarrier) {
-        return announcedBarrier.getCheckpointOptions().isTimeoutable()
-                ? System.nanoTime()
-                : Long.MAX_VALUE;
+    /** A provider for a method to register a delayed action. */
+    @FunctionalInterface
+    public interface DelayedActionRegistration {
+        void schedule(Callable<?> callable, Duration delay);

Review comment:
       I'm thinking about cancellation of the scheduled timers after they are 
no longer needed (upon last barrier, timing out passively, subsumed, aborted).
   
   Depending on the effective checkpoint interval and alignmentTimeout there 
can be up to alignmentTimeout / interval active timers.
   
   E.g. if interval = 1s and timeout = 20m then numTimers = 1200, firing every 
second. This is further multiplied by the number of tasks for a single TM.
   
   Or am I 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.

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


Reply via email to