[
https://issues.apache.org/jira/browse/KAFKA-2655?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jason Gustafson resolved KAFKA-2655.
------------------------------------
Resolution: Not A Problem
Closing this issue as not a problem (any longer). I think the cause of of the
observed overhead was the implementation of an earlier version of the inner
while loop in KafkaConsumer.poll(). The logic was something like this:
{code}
long deadline = time.milliseconds() + now;
while (now <= deadline) {
// check for available record
now = time.milliseconds();
}
{code}
Even when the timeout is 0, at least one millisecond had to tick off in order
to exit the loop. We changed the logic to use a do/while loop which results in
just one iteration of the loop when the timeout is 0.
> Consumer.poll(0)'s overhead too large
> -------------------------------------
>
> Key: KAFKA-2655
> URL: https://issues.apache.org/jira/browse/KAFKA-2655
> Project: Kafka
> Issue Type: Sub-task
> Components: consumer
> Reporter: Guozhang Wang
> Assignee: Jason Gustafson
> Fix For: 0.9.0.1
>
>
> Currently with a single partition, even if it is paused, calling poll(0)
> could still be costing as much as 1ms since it triggers a few system calls.
> Some of those can possibly be optimized away.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)