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

FencedInstanceIdException can cause heartbeat thread to never be closed

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

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.5.1, 2.7.0
    • Fix Version/s: None
    • Component/s: clients
    • Labels:
      None

      Description

      The bug has been there since static consumers was introduced.

      The problem is all within AbstractCoordinator.java

      If a FencedInstanceIdException is throw and onFailure (line 1406) is called by a thread other than the heartbeat thread this will occur.  

      In the onFailure callback the heartbeatThread.failed is set and the heartbeatThread is disabled, but the actual thread is waiting on line 1350 (AbstractCoordinator.this.wait())

      Sometime later pollHeartbeat is called (line 316).  The check for hasFailed is true so it sets heartbeatThread = null without freeing the thread and now it will never be closed.

       

      I have verified this within a debuger using two clients that create read and close over and over again using the same group and instance id.  I tested this with 2.5.1 but found the same code bug to be in the latest master branch, the above line numbers are for the latest in github.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              brianhks Brian Hawkins

              Dates

              • Created:
                Updated:

                Issue deployment