Pan Pan created KAFKA-1349: ------------------------------ Summary: Fatal error during KafkaServerStable startup Key: KAFKA-1349 URL: https://issues.apache.org/jira/browse/KAFKA-1349 Project: Kafka Issue Type: Bug Components: core Affects Versions: 0.8.1 Environment: Ubuntu + scala 2.10 + Kafka 0.8.1 release version Reporter: Pan Pan Fix For: 0.8.1
Kafka broker kept on restarting itself. Exceptions are shown in server.log: [2014-03-28 15:09:01,624] INFO Will not load MX4J, mx4j-tools.jar is not in the classpath (kafka.utils.Mx4jLoader$) [2014-03-28 15:09:01,635] INFO conflict in /controller data: 2108872 stored data: {"version":1,"brokerid":2310736,"timestamp":"1396014892001"} (kafka.utils.ZkUtils$) [2014-03-28 15:09:01,638] FATAL Fatal error during KafkaServerStable startup. Prepare to shutdown (kafka.server.KafkaServerStartable) java.lang.NumberFormatException: For input string: "{"version":1,"brokerid":2310736,"timestamp":"1396014892001"}" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Integer.parseInt(Integer.java:481) at java.lang.Integer.parseInt(Integer.java:514) at scala.collection.immutable.StringLike$class.toInt(StringLike.scala:207) at scala.collection.immutable.StringOps.toInt(StringOps.scala:31) at kafka.server.ZookeeperLeaderElector.elect(ZookeeperLeaderElector.scala:60) at kafka.server.ZookeeperLeaderElector.startup(ZookeeperLeaderElector.scala:43) at kafka.controller.KafkaController.startup(KafkaController.scala:396) at kafka.server.KafkaServer.startup(KafkaServer.scala:96) at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:34) at kafka.Kafka$.main(Kafka.scala:46) at kafka.Kafka.main(Kafka.scala) [2014-03-28 15:09:01,639] INFO [Kafka Server 2108872], Shutting down (kafka.server.KafkaServer) [2014-03-28 15:09:01,640] INFO Closing zookeeper client... (kafka.server.KafkaZooKeeper) [2014-03-28 15:09:01,644] INFO [Socket Server on Broker 2108872], Shutting down (kafka.network.SocketServer) [2014-03-28 15:09:01,648] INFO [Socket Server on Broker 2108872], Shutdown completed (kafka.network.SocketServer) I checked the source code, there are bugs in code: https://git-wip-us.apache.org/repos/asf?p=kafka.git;a=blob;f=core/src/main/scala/kafka/server/ZookeeperLeaderElector.scala;h=33b73609b1178c56e692fb60e35aca04ad1af586;hb=8e554c4d2acf5108805905b9f06198f20398ee3a https://git-wip-us.apache.org/repos/asf?p=kafka.git;a=blob;f=core/src/main/scala/kafka/utils/ZkUtils.scala;h=d1c4b3d7b3d11c88a1d1474aadbb727704cfb759;hb=8e554c4d2acf5108805905b9f06198f20398ee3a In ZookeeperLeaderElector.scala line 57, Int brokerId is passed in as fourth parameter, while in ZkUtils.scala line 307, the declaration for the fourth paramenter is expectedCallerData: Any. -- This message was sent by Atlassian JIRA (v6.2#6252)