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

Aitozi commented on FLINK-28838:
--------------------------------

I think the source api can be improved from two ways:

- check the {{RecordsWithSplitIds}} whether isEmpty before put it in the 
element queue
- add the default mechanism to cool down the fetch task, if there is no data 

> Avoid to notify the elementQueue consumer when the fetch result is empty
> ------------------------------------------------------------------------
>
>                 Key: FLINK-28838
>                 URL: https://issues.apache.org/jira/browse/FLINK-28838
>             Project: Flink
>          Issue Type: Improvement
>          Components: Connectors / Common
>    Affects Versions: 1.15.0, 1.15.1
>            Reporter: Aitozi
>            Priority: Major
>         Attachments: 20220805165441.jpg
>
>
> When using the new source api, I found that if the source has no data, it 
> still brings high cpu usage. 
> The reason behind this is that it will always return the 
> {{RecordsWithSplitIds}} from the {{splitReader.fetch}} in FetchTask and it 
> will be added to the elementQueue. It will make the consumer be notified to 
> wake up frequently.
> the top thread shown by arthas



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to