vert-x3 / vertx-zookeeper

Zookeeper based cluster manager implementation
Other
73 stars 67 forks source link

cleanup of data from zookeeper server incase of vertx server crash #14

Closed srdoshi closed 8 years ago

srdoshi commented 8 years ago

I have vertx.io 3.1.0 server which does clustering using vertx-zookeeper (3.0.0 ) . The zookeeper server is on 3.4.6.

My ui app uses vertxbus.js client to talk to vertx.io server and registers for various addresses. These addresses get saved in zookeeper under /subs path

e.g if the ui ( browser ) opens a socket and registers to listen to address test101 the path on zookeeper is /asyncMultiMap/subs/test101.

When I close the browser the path gets deleted correctly so when next time i ask for /subs the 'test101' is not present in the response. So alls good.

The problem I am seeing is when if I kill the vertx server before i close the browser and then restart the server, the 'test101' path is returned when I request for /subs.

How and who will remove this 'test101' from /subs path from zookeeper ?

stream-iori commented 8 years ago

The problem I am seeing is when if I kill the vertx server before i close the browser and then restart the > server, the 'test101' path is returned when I request for /subs.

Vertx will keep a session with ZK, if you kill vertx and then immediately start it again, then test101 will be still there. you can change the session timeout in here https://github.com/vert-x3/vertx-zookeeper/blob/master/src/main/resources/default-zookeeper.properties#L6