Skip to content

please let zookeeper io socket set tcp keepalive #92

@Pabears

Description

@Pabears

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);

...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions