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 interval should be timeout/2 #5

Merged
merged 1 commit into from
Jul 14, 2021

Conversation

ifo20
Copy link

@ifo20 ifo20 commented Jul 14, 2021

This pull request resolves streadway/amqp#493

As per https://www.rabbitmq.com/heartbeats.html#heartbeats-interval

Heartbeat frames are sent about every heartbeat timeout / 2 seconds. This value is sometimes referred to as the heartbeat interval. After two missed heartbeats, the peer is considered to be unreachable. Different clients manifest this differently but the TCP connection will be closed. When a client detects that RabbitMQ node is unreachable due to a heartbeat, it needs to re-connect.
It is important to not confuse the timeout value with the interval one. RabbitMQ configuration exposes the timeout value, so do the officially supported client libraries. However some clients might expose the interval, potentially causing confusion.

[I did my best to follow the guidelines - I am not sure what tests/example would be appropriate to add here, hence I haven't added any...]

@michaelklishin
Copy link
Member

Ideally we should also introduce a reasonable minimum (e.g. timeout/2 but no less than 5s) but this is a good first step 👍
Thank you for contributing!

@michaelklishin michaelklishin merged commit de74e8a into rabbitmq:main Jul 14, 2021
@lukebakken lukebakken added this to the 1.1.0 milestone Jan 4, 2022
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.

Potential heartbeat misconfiguration
3 participants