Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heartbeat mechanism #75

Open
jam231 opened this issue Apr 8, 2014 · 0 comments
Open

Heartbeat mechanism #75

jam231 opened this issue Apr 8, 2014 · 0 comments

Comments

@jam231
Copy link
Owner

jam231 commented Apr 8, 2014

Current mechanism (setting SO_KEEPALIVE via sockopt) can take up to 2h to detect invalid connection state.
I propose incorporating heartbeat messages into protocol and the following algorithm for handling dead connection discovery:

  1. Set timer to fire each x seconds with heartbeat signal.
  2. Handle this signal by:
    For every connection:
    1. If connection has set probably_alive then negate probably_alive and send heartbeat to that connection.
    2. Else remove the connection from pool
  3. On receiving from connection answer for heartbeat set probably_alive on the connection.
@jam231 jam231 changed the title Heartbeat mechanism. Heartbeat mechanism Apr 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant