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

Jun Rao resolved KAFKA-7956.
----------------------------
       Resolution: Fixed
         Assignee: Gardner Vickers
    Fix Version/s: 2.3.0

Merged the PR to trunk.

> Avoid blocking in ShutdownableThread.awaitShutdown if the thread has not been 
> started
> -------------------------------------------------------------------------------------
>
>                 Key: KAFKA-7956
>                 URL: https://issues.apache.org/jira/browse/KAFKA-7956
>             Project: Kafka
>          Issue Type: Improvement
>          Components: core
>            Reporter: Gardner Vickers
>            Assignee: Gardner Vickers
>            Priority: Minor
>             Fix For: 2.3.0
>
>
> Opening this Jira to track [https://github.com/apache/kafka/pull/6218], since 
> it's a rather subtle change.
> In some test cases it's desirable to instantiate a subclass of 
> `ShutdownableThread` without starting it. Since most subclasses of 
> `ShutdownableThread` put cleanup logic in `ShutdownableThread.shutdown()`, 
> being able to call `shutdown()` on the non-running thread would be useful.
> This change allows us to avoid blocking in `ShutdownableThread.shutdown()` if 
> the thread's `run()` method has not been called. We also add a check that 
> `initiateShutdown()` was called before `awaitShutdown()`, to protect against 
> the case where a user calls `awaitShutdown()` before the thread has been 
> started, and unexpectedly is not blocked on the thread shutting down. 
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to