pnowojski commented on a change in pull request #10345: [FLINK-12484][runtime]
synchronize all mailbox actions
URL: https://github.com/apache/flink/pull/10345#discussion_r353810686
##########
File path:
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/mailbox/MailboxProcessor.java
##########
@@ -179,13 +179,20 @@ public void allActionsCompleted() {
// keep state check and poison mail enqueuing atomic,
such that no intermediate #close may cause a
// MailboxStateException in #sendPriorityMail.
if (mailbox.getState() == TaskMailbox.State.OPEN) {
- sendPriorityMail(() -> mailboxLoopRunning =
false, "poison mail");
+ sendControlMail(() -> mailboxLoopRunning =
false, "poison mail");
}
});
}
- private void sendPriorityMail(RunnableWithException priorityMail,
String descriptionFormat, Object... descriptionArgs) {
- mainMailboxExecutor.executeFirst(priorityMail,
descriptionFormat, descriptionArgs);
+ /**
+ * Sends the given <code>mail</code> using {@link
TaskMailbox#putFirst(Mail)} .
+ * Intended use is to control this <code>MailboxProcessor</code>; no
interaction with tasks should be performed;
+ */
+ private void sendControlMail(RunnableWithException mail, String
descriptionFormat, Object... descriptionArgs) {
+ mailbox.putFirst(new Mail(mail,
Review comment:
nit: the same formatting issue: `mail` should be in a new line as well, and
the parameters should have a single indentation (or two for a function
declaration)
----------------------------------------------------------------
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