1996fanrui commented on code in PR #19723:
URL: https://github.com/apache/flink/pull/19723#discussion_r876530596


##########
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/SubtaskCheckpointCoordinatorImpl.java:
##########
@@ -335,6 +379,49 @@ public void checkpointState(
         }
     }
 
+    private void registerAlignmentTimer(
+            long checkpointId,
+            OperatorChain<?, ?> operatorChain,
+            CheckpointBarrier checkpointBarrier) {
+        synchronized (lock) {
+            resetAlignmentTimer(checkpointId);
+            if (!checkpointBarrier.getCheckpointOptions().isTimeoutable()) {
+                return;
+            }
+
+            long timerDelay = BarrierAlignmentUtil.getTimerDelay(clock, 
checkpointBarrier);
+
+            Cancellable currentAlignmentTimer =
+                    registerTimer.apply(
+                            () -> {
+                                try {
+                                    
operatorChain.alignedBarrierTimeout(checkpointId);
+                                } catch (Exception e) {
+                                    ExceptionUtils.rethrowIOException(e);
+                                }
+                                synchronized (lock) {
+                                    alignmentTimers.remove(checkpointId);
+                                }
+                                return null;
+                            },
+                            Duration.ofMillis(timerDelay));

Review Comment:
   Same as why the `NavigableMap<Long, Cancellable> alignmentTimers` need to be 
guarded by lock?



-- 
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: [email protected]

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

Reply via email to