Swapnil Ghike created KAFKA-780:
-----------------------------------

             Summary: Reassign partition tool produces NPE in shutdown handler
                 Key: KAFKA-780
                 URL: https://issues.apache.org/jira/browse/KAFKA-780
             Project: Kafka
          Issue Type: Bug
    Affects Versions: 0.8
            Reporter: Swapnil Ghike
            Priority: Blocker
             Fix For: 0.8


sghike@sghike-mn:~/kafka-local/kafka/bin$ ./kafka-reassign-partitions.sh 
--zookeeper localhost:2181 --path-to-json-file test1.json
[2013-03-03 03:43:54,513] INFO Starting ZkClient event thread. 
(org.I0Itec.zkclient.ZkEventThread)
[2013-03-03 03:43:54,534] INFO Client 
environment:zookeeper.version=3.3.3-1203054, built on 11/17/2011 05:47 GMT 
(org.apache.zookeeper.ZooKeeper)
[2013-03-03 03:43:54,535] INFO Client environment:host.name=192.168.1.107 
(org.apache.zookeeper.ZooKeeper)
[2013-03-03 03:43:54,535] INFO Client environment:java.version=1.6.0_41 
(org.apache.zookeeper.ZooKeeper)
[2013-03-03 03:43:54,535] INFO Client environment:java.vendor=Apple Inc. 
(org.apache.zookeeper.ZooKeeper)
[2013-03-03 03:43:54,535] INFO Client 
environment:java.home=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
 (org.apache.zookeeper.ZooKeeper)
[2013-03-03 03:43:54,535] INFO Client 
environment:java.class.path=:/Users/sghike/.ivy2/cache/org.xerial.snappy/snappy-java/bundles/snappy-java-1.0.4.1.jar:/Users/sghike/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.8.0.jar:~/Users/sghike/.ivy2/cache/org.scala-lang/scala-compiler/jars/scala-compiler-2.8.0.jar:/Users/sghike/.ivy2/cache/log4j/log4j/jars/log4j-1.2.15.jar:/Users/sghike/.ivy2/cache/org.slf4j/slf4j-api/jars/slf4j-api-1.6.4.jar:/Users/sghike/.ivy2/cache/org.apache.zookeeper/zookeeper/jars/zookeeper-3.3.4.jar:/Users/sghike/.ivy2/cache/net.sf.jopt-simple/jopt-simple/jars/jopt-simple-3.2.jar:./../core/target/scala-2.8.0/kafka_2.8.0-0.8-SNAPSHOT.jar:./../core/lib/metrics-annotation-3.0.0-c0c8be71.jar:./../core/lib/metrics-core-3.0.0-c0c8be71.jar:./../core/lib/zkclient-20120522.jar:./../perf/target/scala-2.8.0/kafka-perf_2.8.0-0.8-SNAPSHOT.jar
 (org.apache.zookeeper.ZooKeeper)
[2013-03-03 03:43:54,535] INFO Client 
environment:java.library.path=.:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
 (org.apache.zookeeper.ZooKeeper)
[2013-03-03 03:43:54,535] INFO Client 
environment:java.io.tmpdir=/var/folders/py/4syf5w4d1lg9h4byyrr4pm1m0000gp/T/ 
(org.apache.zookeeper.ZooKeeper)
[2013-03-03 03:43:54,535] INFO Client environment:java.compiler=<NA> 
(org.apache.zookeeper.ZooKeeper)
[2013-03-03 03:43:54,535] INFO Client environment:os.name=Mac OS X 
(org.apache.zookeeper.ZooKeeper)
[2013-03-03 03:43:54,535] INFO Client environment:os.arch=x86_64 
(org.apache.zookeeper.ZooKeeper)
[2013-03-03 03:43:54,535] INFO Client environment:os.version=10.7.5 
(org.apache.zookeeper.ZooKeeper)
[2013-03-03 03:43:54,535] INFO Client environment:user.name=sghike 
(org.apache.zookeeper.ZooKeeper)
[2013-03-03 03:43:54,535] INFO Client environment:user.home=/Users/sghike 
(org.apache.zookeeper.ZooKeeper)
[2013-03-03 03:43:54,536] INFO Client 
environment:user.dir=/Users/sghike/kafka-local/kafka/bin 
(org.apache.zookeeper.ZooKeeper)
[2013-03-03 03:43:54,536] INFO Initiating client connection, 
connectString=localhost:2181 sessionTimeout=30000 
watcher=org.I0Itec.zkclient.ZkClient@67dacccc (org.apache.zookeeper.ZooKeeper)
[2013-03-03 03:43:54,550] INFO Opening socket connection to server 
localhost/0:0:0:0:0:0:0:1:2181 (org.apache.zookeeper.ClientCnxn)
[2013-03-03 03:43:54,558] INFO Socket connection established to 
localhost/0:0:0:0:0:0:0:1:2181, initiating session 
(org.apache.zookeeper.ClientCnxn)
[2013-03-03 03:43:54,766] INFO Session establishment complete on server 
localhost/0:0:0:0:0:0:0:1:2181, sessionid = 0x13d3009f7400003, negotiated 
timeout = 30000 (org.apache.zookeeper.ClientCnxn)
[2013-03-03 03:43:54,768] INFO zookeeper state changed (SyncConnected) 
(org.I0Itec.zkclient.ZkClient)
Successfully started reassignment of partitions Map([foo,0] -> WrappedArray(0))
[2013-03-03 03:43:54,847] INFO Terminate ZkClient event thread. 
(org.I0Itec.zkclient.ZkEventThread)
[2013-03-03 03:43:54,848] INFO Session: 0x13d3009f7400003 closed 
(org.apache.zookeeper.ZooKeeper)
[2013-03-03 03:43:54,848] INFO EventThread shut down 
(org.apache.zookeeper.ClientCnxn)
Exception in thread "Thread-3" java.lang.NullPointerException
        at org.I0Itec.zkclient.ZkClient$2.call(ZkClient.java:416)
        at org.I0Itec.zkclient.ZkClient$2.call(ZkClient.java:413)
        at org.I0Itec.zkclient.ZkClient.retryUntilConnected(ZkClient.java:675)
        at org.I0Itec.zkclient.ZkClient.getChildren(ZkClient.java:413)
        at org.I0Itec.zkclient.ZkClient.deleteRecursive(ZkClient.java:505)
        at kafka.utils.ZkUtils$.deletePathRecursive(ZkUtils.scala:389)
        at 
kafka.admin.ReassignPartitionsCommand$$anon$1.run(ReassignPartitionsCommand.scala:78)

The contents of test1.json -
Before getting parsed -  [{"topic": "foo", "partition": "0", "replicas": "0" }]
After getting parsed - List(Map(topic -> foo, partition -> 0, replicas -> 0)). 
The only topic partition in my system is [foo,0].

Zookeeper did not have /admin path when the reassign partitions tool was run.

This exception is thrown from ZkUtils.deletePathRecursive() which is in the 
shutdown handler of ReassignPartitionsCommand. But I never pressed Ctrl+C, so 
this code should not have executed.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to