[ https://issues.apache.org/jira/browse/KAFKA-2351?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14654927#comment-14654927 ]
Stevo Slavic commented on KAFKA-2351: ------------------------------------- Running single instance of Kafka broker from latest trunk I experienced this not so successful controlled shutdown: {noformat} [2015-08-05 00:19:09,998] INFO [Offset Manager on Broker 0]: Removed 0 expired offsets in 0 milliseconds. (kafka.server.OffsetManager) ^C[2015-08-05 00:23:09,144] INFO [Kafka Server 0], shutting down (kafka.server.KafkaServer) [2015-08-05 00:23:09,146] INFO [Kafka Server 0], Starting controlled shutdown (kafka.server.KafkaServer) [2015-08-05 00:23:09,155] ERROR [KafkaApi-0] error when handling request Name: ControlledShutdownRequest; Version: 0; CorrelationId: 0; BrokerId: 0 (kafka.server.KafkaApis) kafka.common.ControllerMovedException: Controller moved to another broker. Aborting controlled shutdown at kafka.controller.KafkaController.shutdownBroker(KafkaController.scala:231) at kafka.server.KafkaApis.handleControlledShutdownRequest(KafkaApis.scala:146) at kafka.server.KafkaApis.handle(KafkaApis.scala:63) at kafka.server.KafkaRequestHandler.run(KafkaRequestHandler.scala:60) at java.lang.Thread.run(Thread.java:745) [2015-08-05 00:23:09,156] INFO [Kafka Server 0], Remaining partitions to move: (kafka.server.KafkaServer) [2015-08-05 00:23:09,156] INFO [Kafka Server 0], Error code from controller: -1 (kafka.server.KafkaServer) [2015-08-05 00:23:14,160] WARN [Kafka Server 0], Retrying controlled shutdown after the previous attempt failed... (kafka.server.KafkaServer) [2015-08-05 00:23:14,166] ERROR [KafkaApi-0] error when handling request Name: ControlledShutdownRequest; Version: 0; CorrelationId: 1; BrokerId: 0 (kafka.server.KafkaApis) kafka.common.ControllerMovedException: Controller moved to another broker. Aborting controlled shutdown at kafka.controller.KafkaController.shutdownBroker(KafkaController.scala:231) at kafka.server.KafkaApis.handleControlledShutdownRequest(KafkaApis.scala:146) at kafka.server.KafkaApis.handle(KafkaApis.scala:63) at kafka.server.KafkaRequestHandler.run(KafkaRequestHandler.scala:60) at java.lang.Thread.run(Thread.java:745) [2015-08-05 00:23:14,167] INFO [Kafka Server 0], Remaining partitions to move: (kafka.server.KafkaServer) [2015-08-05 00:23:14,167] INFO [Kafka Server 0], Error code from controller: -1 (kafka.server.KafkaServer) [2015-08-05 00:23:19,169] WARN [Kafka Server 0], Retrying controlled shutdown after the previous attempt failed... (kafka.server.KafkaServer) [2015-08-05 00:23:19,172] ERROR [KafkaApi-0] error when handling request Name: ControlledShutdownRequest; Version: 0; CorrelationId: 2; BrokerId: 0 (kafka.server.KafkaApis) kafka.common.ControllerMovedException: Controller moved to another broker. Aborting controlled shutdown at kafka.controller.KafkaController.shutdownBroker(KafkaController.scala:231) at kafka.server.KafkaApis.handleControlledShutdownRequest(KafkaApis.scala:146) at kafka.server.KafkaApis.handle(KafkaApis.scala:63) at kafka.server.KafkaRequestHandler.run(KafkaRequestHandler.scala:60) at java.lang.Thread.run(Thread.java:745) [2015-08-05 00:23:19,173] INFO [Kafka Server 0], Remaining partitions to move: (kafka.server.KafkaServer) [2015-08-05 00:23:19,173] INFO [Kafka Server 0], Error code from controller: -1 (kafka.server.KafkaServer) [2015-08-05 00:23:24,176] WARN [Kafka Server 0], Retrying controlled shutdown after the previous attempt failed... (kafka.server.KafkaServer) [2015-08-05 00:23:24,177] WARN [Kafka Server 0], Proceeding to do an unclean shutdown as all the controlled shutdown attempts failed (kafka.server.KafkaServer) [2015-08-05 00:23:24,180] INFO [Socket Server on Broker 0], Shutting down (kafka.network.SocketServer) [2015-08-05 00:23:24,189] INFO [Socket Server on Broker 0], Shutdown completed (kafka.network.SocketServer) [2015-08-05 00:23:24,190] INFO [Kafka Request Handler on Broker 0], shutting down (kafka.server.KafkaRequestHandlerPool) [2015-08-05 00:23:24,193] INFO [Kafka Request Handler on Broker 0], shut down completely (kafka.server.KafkaRequestHandlerPool) [2015-08-05 00:23:24,196] INFO [Replica Manager on Broker 0]: Shutting down (kafka.server.ReplicaManager) [2015-08-05 00:23:24,196] INFO [ReplicaFetcherManager on broker 0] shutting down (kafka.server.ReplicaFetcherManager) [2015-08-05 00:23:24,197] INFO [ReplicaFetcherManager on broker 0] shutdown completed (kafka.server.ReplicaFetcherManager) [2015-08-05 00:23:24,197] INFO [ExpirationReaper-0], Shutting down (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper) [2015-08-05 00:23:24,310] INFO [ExpirationReaper-0], Stopped (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper) [2015-08-05 00:23:24,310] INFO [ExpirationReaper-0], Shutdown completed (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper) [2015-08-05 00:23:24,310] INFO [ExpirationReaper-0], Shutting down (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper) [2015-08-05 00:23:24,413] INFO [ExpirationReaper-0], Stopped (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper) [2015-08-05 00:23:24,413] INFO [ExpirationReaper-0], Shutdown completed (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper) [2015-08-05 00:23:24,420] INFO [Replica Manager on Broker 0]: Shut down completely (kafka.server.ReplicaManager) [2015-08-05 00:23:24,421] INFO Shutting down. (kafka.log.LogManager) [2015-08-05 00:23:24,451] INFO Shutdown complete. (kafka.log.LogManager) [2015-08-05 00:23:24,452] INFO [ConsumerCoordinator 0]: Shutting down. (kafka.coordinator.ConsumerCoordinator) [2015-08-05 00:23:24,453] INFO [ExpirationReaper-0], Shutting down (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper) [2015-08-05 00:23:24,494] INFO [ExpirationReaper-0], Stopped (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper) [2015-08-05 00:23:24,494] INFO [ExpirationReaper-0], Shutdown completed (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper) [2015-08-05 00:23:24,494] INFO [ExpirationReaper-0], Shutting down (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper) [2015-08-05 00:23:24,513] INFO [ExpirationReaper-0], Stopped (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper) [2015-08-05 00:23:24,513] INFO [ExpirationReaper-0], Shutdown completed (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper) [2015-08-05 00:23:24,514] INFO [ConsumerCoordinator 0]: Shutdown complete. (kafka.coordinator.ConsumerCoordinator) [2015-08-05 00:23:24,517] INFO Terminate ZkClient event thread. (org.I0Itec.zkclient.ZkEventThread) [2015-08-05 00:23:24,602] INFO Session: 0x14ef8883c9e0008 closed (org.apache.zookeeper.ZooKeeper) [2015-08-05 00:23:24,602] INFO EventThread shut down (org.apache.zookeeper.ClientCnxn) [2015-08-05 00:23:24,602] INFO [Kafka Server 0], shut down completed (kafka.server.KafkaServer) {noformat} Is that unwanted behavior (going to be) handled by this ticket? > Brokers are having a problem shutting down correctly > ---------------------------------------------------- > > Key: KAFKA-2351 > URL: https://issues.apache.org/jira/browse/KAFKA-2351 > Project: Kafka > Issue Type: Bug > Reporter: Mayuresh Gharat > Assignee: Mayuresh Gharat > Attachments: KAFKA-2351.patch, KAFKA-2351_2015-07-21_14:58:13.patch, > KAFKA-2351_2015-07-23_21:36:52.patch > > > The run() in Acceptor during shutdown might throw an exception that is not > caught and it never reaches shutdownComplete due to which the latch is not > counted down and the broker will not be able to shutdown. -- This message was sent by Atlassian JIRA (v6.3.4#6332)