Izeren commented on code in PR #29954:
URL: https://github.com/apache/flink/pull/29954#discussion_r4600505928
##########
flink-runtime/src/main/java/org/apache/flink/streaming/runtime/tasks/mailbox/MailboxProcessor.java:
##########
@@ -331,15 +331,16 @@ private void sendPoisonMail(RunnableWithException mail) {
/**
* Sends the given <code>mail</code> with urgent. Intended use is to
control this <code>
- * MailboxProcessor</code>; no interaction with tasks should be performed;
+ * MailboxProcessor</code>; no interaction with tasks should be performed.
The mail is served
+ * before all non-urgent mails, but after urgent mails that are already
pending (FIFO).
Review Comment:
I think during original PR we have been discussing with Rui whether it is
worth to have 2 queues:
standard queue + priority queue and simplify understanding of how this is
handled.
In original PR, I recall that the idea was to avoid introducing second queue
via doing double reversing of the priority messages (adding them to the
beginning of the queue and then doing addFirst when moving them to batch for
processing).
Is my understanding correct that the bug we are fixing here not coming from
the priority implementation but rather from the fact that we have promoted to
checkpoint messages to urgent, which allowed them to overtake operator events
like split assignment (which are non-urgent) and that is what causing the bug?
##########
flink-runtime/src/main/java/org/apache/flink/streaming/runtime/tasks/mailbox/TaskMailbox.java:
##########
@@ -30,6 +30,15 @@
* A task mailbox provides read and write access to a mailbox and has a
lifecycle of open ->
* (quiesced) -> closed. Mails have a priority that can be used to retrieve
only relevant letters.
*
+ * <h3>Priority and urgency</h3>
Review Comment:
Why does it have to be that complicated? If we have 2 FIFO queues with
guarantee that standard queue is only processed once priority queue is empty,
we don't really need separate concepts of priority and urgency. Priority ->
Which queue; Urgency -> Order in the queue (which is implicit)
--
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]