Chia-Ping Tsai created KAFKA-21445:
--------------------------------------

             Summary: 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: Chia-Ping Tsai


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