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

Avoid calling lookupCoordinator() in tight loop

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

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.1.0, 3.1.1, 3.3.0, 3.1.2, 3.2.1
    • 3.3.0, 3.2.1
    • consumer
    • None

    Description

      Currently the heartbeat thread's lookupCoordinator() is called in a tight loop if brokers crash and the consumer is left running. Besides that it floods the logs on debug level, it increases CPU usage as well.

      The fix is easy, just need to put a backoff call after coordinator lookup.

      Reproduction:

      1. Start a few brokers
      2. Create a topic and produce to it
      3. Start consuming
      4. Stop all brokers
        At this point lookupCoordinator() will be called in a tight loop.

      Attachments

        Activity

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

          People

            viktorsomogyi Viktor Somogyi-Vass
            viktorsomogyi Viktor Somogyi-Vass
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment