You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Chia-Ping Tsai (Jira)" <ji...@apache.org> on 2024/06/21 15:01:00 UTC

[jira] [Created] (KAFKA-17017) AsyncConsumer#unsubscribe does not clean the assigned partitions

Chia-Ping Tsai created KAFKA-17017:
--------------------------------------

             Summary: AsyncConsumer#unsubscribe does not clean the assigned partitions
                 Key: KAFKA-17017
                 URL: https://issues.apache.org/jira/browse/KAFKA-17017
             Project: Kafka
          Issue Type: Bug
            Reporter: Chia-Ping Tsai
            Assignee: Chia-Ping Tsai


According to docs [0] `Consumer#unsubscribe` should clean both subscribed and assigned partitions. However, there are two issues about `AsyncConsumer`

1)  if we don't set group id,  `AsyncConsumer#unsubscribe`[1] will be no-op
2)  if we set group id, `AsyncConsumer` is always in `UNSUBSCRIBED` state and so `MembershipManagerImpl#leaveGroup` will be no-op

[0] https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java#L759
[1] https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java#L1479
[2] https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/clients/consumer/internals/MembershipManagerImpl.java#L666



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