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

implemented heartbeat timer for LibUV example #510

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

thidas1290
Copy link

broker disconnects the client when heartbeats are not sent in the given LibUV example

rabbitmq-timeout
  • implemented a timer for sending heartbeats.

@EmielBruijntjes
Copy link
Member

For LibEv this has already been implemented, but the code is much more complex over there. For example:

  • It is possible for a single LibEv instance to monitor multiple connections (and thus have multiple timers active)
  • What if the object is destructed before any heartbeat timers were activated?
  • We also take into account that no heartbeats have to be sent if we already sent some other kind of data
  • We also close the connection if the server failed to send a heartbeat in time
  • We do some stuff with interval/2 to ensure that we're really on time with sending the heartbeat

Can you take a look at such things? Otherwise it might be better to just disable heartbeats.

Copy link
Member

@EmielBruijntjes EmielBruijntjes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Take a look at the LibEv implementation, which has much more details to send and process heartbeats. Is it possible to turn that class into a libuv implementation?

@thidas1290
Copy link
Author

@EmielBruijntjes updated the LibUV heartbeat implementation referencing LibEv example such that,

  • can have multiple connections, each connection having a heartbeat timer and multiple fd watchers.
  • overall heartbeat sending logic remains untouched, changes are made only to time conversions and LibUv specific functions

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.

2 participants