Skip to content

Conversation

@jahqueel
Copy link
Contributor

If the server stops responding to pings (or anything else) while CONNECTED, the library doesn't notice until a TCP timeout occurs, which takes much longer than the sessionTimeout. It's possible to reproduce this via iptables:

iptables -I INPUT 1 -s current_zk_ip -j DROP

The java library tracks when it last received a message from the server, and disconnects when it's been longer than the session timeout.

This patch replicates that functionality.

If there is a network connectivity issue with the server, we could end
up waiting for a TCP timeout before detecting that our pings are not
being responded to.

Instead, let's keep track of the last time the server sent us a message
and initiate a reconnect if we haven't received anything within a
sessionTimeout interval.
@jahqueel
Copy link
Contributor Author

This may mitigate #16 as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant