Skip to content

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