zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wsk-528 <wsk-...@163.com>
Subject too many open files occur while the network cable is pulled out#zookeeper3.4.6#java client
Date Sun, 20 Dec 2015 15:01:24 GMT
    accidentally,i find a problem than the zookeeper client print "too many open files" with
server version 3.4.6, and i use the same java client version.
    the env is like this:the server running on server A, and the client running on server
B(RHEL AS5), when i pull out the cable between them, the client print "too many open files"
,and network unreachable.
    i test if i shutdown the network interface,the same log was printed.
    i use lsof -p <pid>,i can see a lot of socket file handle.

    my code is as following:
   public class ZKTest {

* @param args
* @throws IOException 
* @throws InterruptedException 
* @throws KeeperException 
public static void main(String[] args) throws IOException, InterruptedException, KeeperException
ZooKeeper zk = new ZooKeeper(args[0], 30000, new Watcher() {

public void process(WatchedEvent event) {
if(event.getState()==KeeperState.SyncConnected) {
} else if(event.getState()==KeeperState.Disconnected) {
} else if(event.getState()==KeeperState.Expired) {
} else {
System.out.println("unknow " + event.getState());
zk.exists("/testpath", false);
Object o = new Object();
synchronized(o) {


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message