Aitozi 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_r287757034
##########
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:
1. ~~Regarding this checkpointLock, I think after this PR all timer's
`onProcessingTime` will be executed in the main thread without multi-thread
execution.~~ After double thought, I think you are right now.., because the
checkpoint path has not been refactor to use mailbox to synchronize. The lock
may be need to be removed by an individual PR later , i think.
2. Regarding timer cancellation, i want to hear some suggestion from Stefan.
----------------------------------------------------------------
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