Skip to content

Instantly share code, notes, and snippets.

@gyim
gyim / curatortest.java
Last active August 29, 2015 14:21
Connection LOST is sometimes not reported in Apache Curator
/*
* Usage:
* 1. Start this program with `java -jar curator-test.jar <zkHost:zkPort>`.
* Use a non-local ZooKeeper server.
* 2. Run the following command in another window:
* iptables -A OUTPUT -p tcp --dport 2181 -j DROP; sleep 15; iptables -D OUTPUT -p tcp --dport 2181 -j DROP
*
* Expected result: the program exits after receiving LOST connection state
*
* Result: the program usually does not exit (it receives only SUSPENDED and RECONNECTED events),