1u0 commented on a change in pull request #9772: [FLINK-14199] Only use
dedicated/named classes for mailbox letters.
URL: https://github.com/apache/flink/pull/9772#discussion_r333372570
##########
File path:
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamTask.java
##########
@@ -1421,18 +1430,25 @@ private void
checkpointStreamOperator(StreamOperator<?> op) throws Exception {
@Override
public void invoke(ProcessingTimeCallback callback, long
timestamp) {
try {
-
mailboxProcessor.getMailboxExecutor(TaskMailbox.MAX_PRIORITY).execute(() -> {
- synchronized (getCheckpointLock()) {
- try {
-
callback.onProcessingTime(timestamp);
- } catch (Throwable t) {
-
handleAsyncException("Caught exception while processing timer.", new
TimerException(t));
- }
- }
- });
+
mailboxProcessor.getMailboxExecutor(TaskMailbox.MAX_PRIORITY)
+ .execute(
+ () ->
invokeCallback(callback, timestamp),
+ lazy(() ->
"Timer callback for " + callback + " @ " + timestamp));
} catch (Throwable t) {
handleAsyncException("Caught exception while
processing timer.", new TimerException(t));
}
}
+
+ private void invokeCallback(ProcessingTimeCallback callback,
long timestamp) {
Review comment:
Same suggestion, to give this method a more descriptive name. For example:
`invokeProcessingTimeCallback()`, `invokeTimerCallback()`.
----------------------------------------------------------------
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