Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What exactly getChildren function does internally ? #75

Open
pramodpatilolx opened this issue Oct 4, 2016 · 3 comments
Open

What exactly getChildren function does internally ? #75

pramodpatilolx opened this issue Oct 4, 2016 · 3 comments

Comments

@pramodpatilolx
Copy link

I have 3 zookeepers running and while creating Zookeeper object I specify csv of all 3 hosts.

For eg. \ZooKeeper("host1:port1,host2:port2,host3:port2", null, $timeout);

If I kill one zookeeper node I get 'connection loss' error sometimes from getChildren.
If I kill 2 zookeeper nodes I am always getting 'connection loss' error.

Does getchildren tries to connect to all zookeeper nodes ?
Can someone explain what this fuction internally does ?

@Timandes
Copy link
Contributor

Timandes commented Oct 5, 2016

Did you kill instances before 'getChildren'?

@pramodpatilolx
Copy link
Author

pramodpatilolx commented Oct 5, 2016

@Timandes No, I killed the instance when no producer or consumer was running(using zookeeper for kafka cluster management). So there is no chance that it's killed after creating a zookeeper instance and before calling getChildren.

Also one clarification required : Is this function asynchronous ? If it is, then probably I should call getchildren from within the callback.

@Timandes
Copy link
Contributor

Timandes commented Oct 6, 2016

First, I'm not quite sure the situation you mentioned. But I'm sure that Method 'connect' do nothing but save the list of servers.
Second, @andreiz uses mt lib of zookeeper. So it always has at least two threads no matter the extension uses zoo_a* functions or not. And the callbacks is always called in the worker thread.

Is this what you need?
Or I missed your point again...?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants