You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "huxihx (JIRA)" <ji...@apache.org> on 2017/07/27 03:53:00 UTC

[jira] [Created] (KAFKA-5665) Incorrect interruption invoking method used for Heartbeat thread

huxihx created KAFKA-5665:
-----------------------------

             Summary: Incorrect interruption invoking method used for Heartbeat thread 
                 Key: KAFKA-5665
                 URL: https://issues.apache.org/jira/browse/KAFKA-5665
             Project: Kafka
          Issue Type: Bug
          Components: consumer
    Affects Versions: 0.11.0.0
            Reporter: huxihx
            Assignee: huxihx
            Priority: Minor


When interrupting the background heartbeat thread, `Thread.interrupted();` is used. Actually, `Thread.currentThread().interrupt();` should be used to restore the interruption status. An alternative way to solve is to remove `Thread.interrupted();` since HeartbeatThread extends Thread and all code higher up on the call stack is controlled, so we could safely swallow this exception. Anyway, `Thread.interrupted();`  should not be used here. It's a test method not an action.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)