samuel / go-zookeeper

Native ZooKeeper client for Go. This project is no longer maintained. Please use https://github.com/go-zookeeper/zk instead.
BSD 3-Clause "New" or "Revised" License
1.64k stars 672 forks source link

[feature]: new option WithPingCountWithinSessionTimeout #213

Closed ikenchina closed 5 years ago

ikenchina commented 5 years ago

New option WithPingCountWithinSessionTimeout to configurate how many pings within a session timeout.
Default ping's count were only two pings within a session timeout, it is not enough.
ZK client want to know ping is failed sonner rather than later somethings.
Generally, set your session(or election) timeout to at least 5 to 10 times your heartbeat interval in a distributed system.