You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Bo Cui (Jira)" <ji...@apache.org> on 2022/01/19 10:02:00 UTC

[jira] [Comment Edited] (FLINK-14304) Avoid task starvation with mailbox

    [ https://issues.apache.org/jira/browse/FLINK-14304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17478503#comment-17478503 ] 

Bo Cui edited comment on FLINK-14304 at 1/19/22, 10:01 AM:
-----------------------------------------------------------

hi [~arvid]  why add the condition?

[https://github.com/apache/flink/blob/6512214cb3d5774ae40c8ccae8785a48dc868e2b/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/mailbox/TaskMailboxImpl.java#L260]

 

in my UDF, other thread call collect(row)
{code:java}
public class myUDF extends TableFunction<Row> {
public void eval(Object... objs) throws IOException {
//add data to cache...
}

class myThread extends Thread {
public void run() {
//Processing cache data...
collect(row);
}
}
}{code}


was (Author: bo cui):
hi [~arvid]  why add the condition?

[https://github.com/apache/flink/blob/6512214cb3d5774ae40c8ccae8785a48dc868e2b/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/mailbox/TaskMailboxImpl.java#L260]

 

in my UDF, other thread call collect(row)

 

 
{code:java}
public class myUDF extends TableFunction<Row> {
public void eval(Object... objs) throws IOException {
//add data to cache...
}

class myThread extends Thread {
public void run() {
//Processing cache data...
collect(row);
}
}
}{code}

> Avoid task starvation with mailbox
> ----------------------------------
>
>                 Key: FLINK-14304
>                 URL: https://issues.apache.org/jira/browse/FLINK-14304
>             Project: Flink
>          Issue Type: Improvement
>          Components: Runtime / Task
>            Reporter: Arvid Heise
>            Assignee: Arvid Heise
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.10.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Currently, all mails are always prioritized over regular input, which makes sense in most cases. However, it's easy to devise an operator that gets into starvation: each mail enqueues a new mail.
> This ticket implements a simple extension in the mailbox processor: instead of draining the mailbox one-by-one, fetch all mails from the mailbox and run them one-by-one before running the default action. Only then, fetch all mails again and repeat.
> So we execute all mails that are available at the start of this loop but no mails that are added in the meantime.
> Special attention needs to be directed towards yield to downstream, such that it doesn't process mails outside of the current batch.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)