[ 
https://issues.apache.org/jira/browse/KAFKA-20854?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lianet Magrans updated KAFKA-20854:
-----------------------------------
    Component/s: clients
                 consumer

> A more obvious busy loop due to KIP-909
> ---------------------------------------
>
>                 Key: KAFKA-20854
>                 URL: https://issues.apache.org/jira/browse/KAFKA-20854
>             Project: Kafka
>          Issue Type: Bug
>          Components: clients, consumer
>            Reporter: Chia-Ping Tsai
>            Assignee: Ken Huang
>            Priority: Blocker
>             Fix For: 4.4.0
>
>
> AsyncKafkaConsumer wakes up the background thread to process the poll request:
> {code:java}
>         if (inflightPoll == null) {
>             inflightPoll = new AsyncPollEvent(calculateDeadlineMs(timer), 
> time.milliseconds());
>             newlySubmittedEvent = true;
>             log.trace("Inflight event {} submitted", inflightPoll);
>             applicationEventHandler.add(inflightPoll);
>         }
> {code}
> And `FetchRequestManager` wakes up the main thread if there are no requests 
> to send:
> {code:java}
>             if (fetchRequests.isEmpty()) {
>                 // If there's nothing to fetch, wake up the FetchBuffer so it 
> doesn't needlessly wait for a wakeup
>                 // that won't come until the data in the fetch buffer is 
> consumed.
>                 fetchBuffer.wakeup();
>                 pendingFetchRequestFuture.complete(null);
>                 return PollResult.EMPTY;
>             }
> {code}
> This is an existing issue, and it has become more obvious after KIP-909, 
> since we moved DNS resolution into the poll phase. This means no requests can 
> be sent until DNS resolution completes..



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

Reply via email to