-
Notifications
You must be signed in to change notification settings - Fork 19
Description
Hello.
Since you switched to your mcavage/node-zookeeper fork, there's no more a 'close' event sent when a zookeeper session expires.
We have been able to reproduce this, very easy:
- Start a zookeeper server in a VirtualBox
- Connect to your zookeeper server from your host machine, with a very low timeout (seems 4000ms is the lowest), using latest node-zkplus
- Stop communication between zookeeper server and your client:
sudo ifconfig vboxnet0 down - Wait 5-6s
- Restart communication:
sudo ifconfig vboxnet0 up
What happens:
- all watches are getting -1 etc.. as seen in https://github.com/yfinkelstein/node-zookeeper#known-bugs--issues
Expected behavior:
- a close event should be sent by the native zookeeper lib
Your fork does not send a close event, thus our code around session disconnection and reconnect does not work anymore: 6a97b30
Putting back "official" node-zookeeper works well, because we do receive a close event when session expires.
I guess we could hack
Line 799 in 733906c
| emitter.emit(event); |
What do you think ?
PS1:
I hope you do monitor your zk connection status from a client side.
Because when session expires (eg: network interruption, garbage collector working for more than zookeeper timeout), you will never know it ONLY if you do watch for -1 state in your watches.
PS2:
We could not understand how is it possible that our nodejs client and zookeeper server were not able to reach each other for 30 seconds (our timeout), did you already have experienced similar issues with node-zookeeper? (your fork, the official)