[
https://issues.apache.org/jira/browse/FLINK-16174?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Flink Jira Bot updated FLINK-16174:
-----------------------------------
Labels: auto-deprioritized-major stale-minor (was:
auto-deprioritized-major)
I am the [Flink Jira Bot|https://github.com/apache/flink-jira-bot/] and I help
the community manage its development. I see this issues has been marked as
Minor but is unassigned and neither itself nor its Sub-Tasks have been updated
for 180 days. I have gone ahead and marked it "stale-minor". If this ticket is
still Minor, please either assign yourself or give an update. Afterwards,
please remove the label or in 7 days the issue will be deprioritized.
> Add a better tryYield() method to MailboxExecutor to return the lowest
> priority of the remaining mails
> ------------------------------------------------------------------------------------------------------
>
> Key: FLINK-16174
> URL: https://issues.apache.org/jira/browse/FLINK-16174
> Project: Flink
> Issue Type: Improvement
> Components: Runtime / Task
> Affects Versions: 1.10.0
> Reporter: Haibo Sun
> Priority: Minor
> Labels: auto-deprioritized-major, stale-minor
>
> Currently, we use chainIndex as the priority to create MailboxExecutor to
> process its mails. When MailboxExecutor#tryYield is called to process mails,
> it will take the mails of this operator and all downstream operators in the
> chain. But sometimes, after calling MailboxExecutor#tryYield, we need to know
> whether there is any mail of the current operator in the mailbox, which can
> simplify some operations.
> For example, when we close a operator in runtime, after quiescing the
> processing time service and waiting for its running timers to finish, if
> there is no mail of the current operator in the mailbox, we call
> StreamOperator#close to close the operator. Then the runtime code of closing
> a operator can be simplified as follows.
> {code:java}
> quiesceProcessingTimeService().get();
> while (mailboxExecuto.betterTryYield() <= self.priority) {}
> closeOperator(actionExecutor);
> {code}
> With the existing #tryYield method, if the following simplified code is used
> to close a operator, then when a downstream operator is implemented like
> MailboxOperatorTest.ReplicatingMail, the tryyield() loop will
> be prevented from exiting, which results deadlock.
> {code:java}
> quiesceProcessingTimeService().get();
> while (mailboxExecuto.tryYield()) {}
> closeOperator(actionExecutor);
> {code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)