kazoo icon indicating copy to clipboard operation
kazoo copied to clipboard

childrenwatch will kill the procedure?

Open leafjungle opened this issue 7 years ago • 1 comments

self._zk_client = get_zk_client() self._zk_client.start() ChildrenWatch(self._zk_client, TASK_ZK_PATH, func=self.get_work, send_event=True) print "123"

def get_work(self, children, event) .....

I meet some problems: (1) the event in get_work is always None (I add a child or delete a child), but why? (2) print "123" will not be executed since the whole procedure is killed after ChildWatch(), without any error msg or log, why?

And I am wondering the work mechanism of ChildrenWatch and DataWatch.
proc1: register ChildrenWatch with an action function. proc2: add child to the path.

then proc1 should always run , right? otherwise how does zookeeper server notify the client?

leafjungle avatar Nov 21 '18 06:11 leafjungle

Hi,

I may be suspecting that a ConnectionClosedError is raised but it is ignored since get_children() is wrapped. Have you got any logs on Zookeeper's side?

StephenSorriaux avatar Nov 23 '18 13:11 StephenSorriaux