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



##########
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:
       First of all I think the alignment timeout plays no role in the number 
of timers. There will always be at most two timers for each aligned checkpoints 
(one for the announcement and one for the first barrier). I agree it is 
multiplied by the number of tasks for a single TM.
   
   We briefly discussed that with @AHeise but we thought the number of timers 
will be insignificant compared to the number of records that we can process. 
Especially as in that case the executed code for a timer will be a single 
boolean condition evaluation, as such number of timers can happen only in case 
of successful aligned checkpoints. 




----------------------------------------------------------------
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