In the explanation of the Java binding, it is mentioned "If the file (or znode) exists, it gets the data from the znode, and then invoke the exists() callback of Executor if the state has changed. Note, it doesn't have to do any Exception processing for the getData call because it has watches pending for anything that could cause an error: if the node is deleted before it calls ZooKeeper.getData(), the watch event set by the ZooKeeper.exists()triggers a callback.... "
I read this to mean that if I insert a Thread.sleep() before the getData call & removed the node from the cli, somehow (magically) there would be no error. But of course, it does not happen.... Sleeps for 10 seconds org.apache.zookeeper.KeeperException$NoNodeException: KeeperErrorCode = NoNode for /zk_test at org.apache.zookeeper.KeeperException.create(KeeperException.java:102) at org.apache.zookeeper.KeeperException.create(KeeperException.java:42) at org.apache.zookeeper.ZooKeeper.getData(ZooKeeper.java:921) at org.apache.zookeeper.ZooKeeper.getData(ZooKeeper.java:950) at DataMonitor.processResult(DataMonitor.java:114) at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:512) Am I doing something wrong (or reading something wrong)? -- Milind