We have found this issue when the router is down, and the zk server has sent RST, but the client has not received the RST because the router is down. so, the TCP status is ESTABLISHED but the zk session is totally down, and the client doesn't know it.
We have found this issue when the router is down, and the zk server has sent RST, but the client has not received the RST because the router is down. so, the TCP status is ESTABLISHED but the zk session is totally down, and the client doesn't know it.
the Java codes look like:
import java.net.*; import org.apache.zookeeper.client.ZKClientConfig; import org.apache.zookeeper.ZooKeeper;
...
ZKClientConfig zkClientConfig = new ZKClientConfig(); zkClientConfig.setProperty(ZKClientConfig.ZOOKEEPER_SOCK_OPTS, "SO_KEEPALIVE=true"); ZooKeeper zk = new ZooKeeper("localhost:2181", 3000, null, zkClientConfig);
...