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

Lucy Liu reassigned KAFKA-21445:
--------------------------------

    Assignee: Lucy Liu  (was: Chia-Ping Tsai)

> Add tests to verify the behavior of controlled.shutdown.enable
> --------------------------------------------------------------
>
>                 Key: KAFKA-21445
>                 URL: https://issues.apache.org/jira/browse/KAFKA-21445
>             Project: Kafka
>          Issue Type: Test
>            Reporter: Chia-Ping Tsai
>            Assignee: Lucy Liu
>            Priority: Minor
>
> The config is used to move the leaders when the shutdown is running. However, 
> we just pretended that can happen, as we don't have tests for it. See the 
> `controlledShutdownEnable` branch in `BrokerServer#shutdown`.
>  
>  
> {code:java}
>       if (config.controlledShutdownEnable) {
>         if (replicaManager != null)
>           replicaManager.beginControlledShutdown()        if 
> (lifecycleManager != null) {
>           lifecycleManager.beginControlledShutdown()
>           try {
>             val controlledShutdownTimeoutMs = deadline - time.milliseconds()
>             
> lifecycleManager.controlledShutdownFuture.get(controlledShutdownTimeoutMs, 
> TimeUnit.MILLISECONDS)
>           } catch {
>             case _: TimeoutException =>
>               error("Timed out waiting for the controller to approve 
> controlled shutdown")
>             case e: Throwable =>
>               error("Got unexpected exception waiting for controlled shutdown 
> future", e)
>           }
>         }
>       }
> {code}
>  



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to