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

Lucas Brutschy updated KAFKA-16599:
-----------------------------------
    Component/s: clients
                 consumer

> Always await async commit callbacks in commitSync and close
> -----------------------------------------------------------
>
>                 Key: KAFKA-16599
>                 URL: https://issues.apache.org/jira/browse/KAFKA-16599
>             Project: Kafka
>          Issue Type: Task
>          Components: clients, consumer
>            Reporter: Lucas Brutschy
>            Assignee: Lucas Brutschy
>            Priority: Major
>
> The javadoc for KafkaConsumer.commitSync says:
> {code:java}
> Note that asynchronous offset commits sent previously with the {@link 
> #commitAsync(OffsetCommitCallback)}
> (or similar) are guaranteed to have their callbacks invoked prior to 
> completion of this method.
> {code}
> This is not always true in the legacy consumer, when the set of offsets is 
> empty, the execution of the commit callback is not always awaited. There are 
> also various races possible that can avoid callback handler execution.
> Similarly, there is code in the legacy consumer to await the completion of 
> the commit callback before closing, however, the code doesn't cover all cases 
> and the behavior is therefore inconsistent. While the Javadoc doesn't 
> explicitly promise callback execution, it promises "completing commits", 
> which one would reasonably expect to include callback execution. Either way, 
> the current behavior of the legacy consumer is inconsistent.



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

Reply via email to