Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-16639

AsyncKafkaConsumer#close does not send heartbeat to leave group

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      This bug can be reproduced by immediately closing a consumer which is just created.

      The root cause is that we skip the new heartbeat used to leave group when there is a in-flight heartbeat request (https://github.com/apache/kafka/blob/5de5d967adffd864bad3ec729760a430253abf38/clients/src/main/java/org/apache/kafka/clients/consumer/internals/HeartbeatRequestManager.java#L212).

      It seems to me the simple solution is that we create a heartbeat request when meeting above situation and then send it by pollOnClose (https://github.com/apache/kafka/blob/5de5d967adffd864bad3ec729760a430253abf38/clients/src/main/java/org/apache/kafka/clients/consumer/internals/RequestManager.java#L62).

       

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            frankvicky TengYao Chi
            chia7712 Chia-Ping Tsai
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment