[
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 auto-deprioritized-minor (was:
auto-deprioritized-major stale-minor)
Priority: Not a Priority (was: Minor)
This issue was labeled "stale-minor" 7 days ago and has not received any
updates so it is being deprioritized. If this ticket is actually Minor, please
raise the priority and ask a committer to assign you the issue or revive the
public discussion.
> 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: Not a Priority
> Labels: auto-deprioritized-major, auto-deprioritized-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)