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

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

     [ https://issues.apache.org/jira/browse/KAFKA-5665?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

huxihx resolved KAFKA-5665.
---------------------------
    Resolution: Not A Bug

> 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)