Skip to content

Session expired bad behavior #15

@vvo

Description

@vvo

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:

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

emitter.emit(event);
to watch for session event and call onClose manually.

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions