kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guozh...@apache.org
Subject [kafka] branch trunk updated: KAFKA-7811: Avoid unnecessary lock acquire when KafkaConsumer commits offsets (#6119)
Date Thu, 14 Feb 2019 17:49:01 GMT
This is an automated email from the ASF dual-hosted git repository.

guozhang pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 795f733  KAFKA-7811: Avoid unnecessary lock acquire when KafkaConsumer commits offsets
(#6119)
795f733 is described below

commit 795f7331e27602fb2579d2aa12f048d546fc4de6
Author: lambdaliu <lambda.tencent@gmail.com>
AuthorDate: Fri Feb 15 01:48:44 2019 +0800

    KAFKA-7811: Avoid unnecessary lock acquire when KafkaConsumer commits offsets (#6119)
    
    Avoid unnecessary lock acquire when KafkaConsumer commits offsets.
    
    Reviewers: Viktor Somogyi-Vass <viktorsomogyi@gmail.com>, Guozhang Wang <wangguoz@gmail.com>
---
 .../main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java b/clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java
index b1d407e..772f973 100644
--- a/clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java
+++ b/clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java
@@ -1459,12 +1459,7 @@ public class KafkaConsumer<K, V> implements Consumer<K, V>
{
      */
     @Override
     public void commitAsync(OffsetCommitCallback callback) {
-        acquireAndEnsureOpen();
-        try {
-            commitAsync(subscriptions.allConsumed(), callback);
-        } finally {
-            release();
-        }
+        commitAsync(subscriptions.allConsumed(), callback);
     }
 
     /**


Mime
View raw message