StefanRRichter commented on a change in pull request #8523: 
[FLINK-12481][runtime] Invoke timer callback in task thread (via mailbox)
URL: https://github.com/apache/flink/pull/8523#discussion_r287728381
 
 

 ##########
 File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamTask.java
 ##########
 @@ -1358,4 +1358,19 @@ public void actionsUnavailable() throws 
InterruptedException {
                        mailbox.putMail(actionUnavailableLetter);
                }
        }
+
+       private class TimerInvocationContext implements 
SystemProcessingTimeService.ScheduledCallbackExecutionContext {
+               @Override
+               public void invoke(ProcessingTimeCallback callback, long 
timestamp) throws InterruptedException {
+                       mailbox.putMail(() -> {
+                               synchronized (getCheckpointLock()) {
 
 Review comment:
   @Aitozi I think this clearly can be dropped when everything goes through the 
mailbox. Right now, I see still one case that must be considered, which is 
`notifyCheckpointComplete` - unlike checkpoint trigger, this also is an RPC 
call for non-source tasks and we need to run it in the mailbox as well before 
we can drop the lock here and only rely on the mailbox and the locking that 
happens in the alternative loop for curent source stream tasks. We should 
remove the lock here in a cleanup PR once all other pieces are in place.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to