You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Guozhang Wang (JIRA)" <ji...@apache.org> on 2019/02/14 17:50:00 UTC

[jira] [Resolved] (KAFKA-7811) Avoid unnecessary lock acquire when KafkaConsumer commits offsets

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

Guozhang Wang resolved KAFKA-7811.
----------------------------------
       Resolution: Fixed
    Fix Version/s: 2.3.0

> Avoid unnecessary lock acquire when KafkaConsumer commits offsets
> -----------------------------------------------------------------
>
>                 Key: KAFKA-7811
>                 URL: https://issues.apache.org/jira/browse/KAFKA-7811
>             Project: Kafka
>          Issue Type: Improvement
>          Components: clients
>    Affects Versions: 0.10.2.2, 0.11.0.3, 1.0.2, 1.1.1, 2.0.1, 2.1.0
>            Reporter: lambdaliu
>            Assignee: lambdaliu
>            Priority: Major
>             Fix For: 2.3.0
>
>
> In KafkaConsumer#commitAsync that does not take offset parameters, we have the following logic:
> {code:java}
> public void commitAsync(OffsetCommitCallback callback) {
>     acquireAndEnsureOpen();
>     try {
>         commitAsync(subscriptions.allConsumed(), callback);
>     } finally {
>         release();
>     }
> }
> {code}
> This function calls another commitAsync with default all consumed offset which also call `acquireAndEnsureOpen`.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)