zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matteo Casadei - Diennea <matteo.casa...@diennea.com>
Subject Code to Simulate ZooKeeper Session Expiration does not Work
Date Wed, 13 Apr 2016 07:39:03 GMT
Hi everybody,

I have an issue on testing ZooKeeper's session expiration.

Basically, I am using the chunk of code below to make a "target"
ZooKeeper handle expire:


...
final ZooKeeper zk = new ZooKeeper(zkAddress , zkTimeout, new Watcher() {

                    @Override
                    public void process(WatchedEvent event) {
                        System.out.println("Received event: " + event);

                    }

        }, serviceZKSessionId, serviceZKpasswd);

        while (zk.getState() != States.CONNECTED) {
            Thread.sleep(100);
          }
        zk.close();
...


however when running the code above, the only event a receive is an expired event while the
target ZooKeeper handle (the one I want to actually expire) simply gets disconnected and immediately
reconnected afterwards.

Can anybody give me a clue on what is actually wrong with this code?


Thanks in advance,
Matteo

--
Matteo Casadei

________________________________

Iscriviti alla nostra newsletter per rimanere aggiornato su digital ed email marketing! http://www.magnews.it/newsletter/

The information in this email is confidential and may be legally privileged. If you are not
the intended recipient please notify the sender immediately and destroy this email. Any unauthorized,
direct or indirect, disclosure, copying, storage, distribution or other use is strictly forbidden.
Mime
View raw message