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
amqp: heartbeat support #2676
amqp: heartbeat support #2676
Conversation
This user does not have permission to start the build. Can one of the admins verify this patch and start the build? |
1 similar comment
This user does not have permission to start the build. Can one of the admins verify this patch and start the build? |
@kira-syslogng ok to test |
Build SUCCESS |
61de053
to
6d48377
Compare
Build FAILURE |
@kira-syslogng retest this please |
Build SUCCESS |
Build FAILURE |
@kira-syslogng retest this please |
1 similar comment
@kira-syslogng retest this please |
Build SUCCESS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for fixing one of the oldest issue/feature request 🥇
break; | ||
|
||
default: | ||
g_assert_not_reached(); | ||
return FALSE; | ||
} | ||
|
||
self->heartbeat = amqp_get_heartbeat(self->conn); | ||
|
||
msg_debug("Amqp heartbeat negotiation", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for the documentation:
As I read the docs, heartbeat can only be turned off, if BOTH sides has a heartbeat value of 0.
https://www.rabbitmq.com/heartbeats.html
Heartbeats can be disabled by setting the timeout interval to 0 on both client and server ends.
On code side we have this debug message, so there is nothing more to do, it's just worth to mention in the docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UPDATE: I've tried this out and this statement seems invalid.
What I've concluded is that generally the negotiated heartbeat interval will be the smaller configured one.
About disabling heartbeating: Client controls enable/disable, therefore even if the server side has an explicit 0 for heartbeat, a client can override this. If the client has a 0, it means disable heartbeat.
(tested with RabbitMQ 3.6.10 server and client 0.8.0 versions).
Users can provide heartbeat in their configuration, that is negotiated with the server. In case heartbeat is enabled, amqp destination will send heartbeats periodically. Signed-off-by: Terez Nemes <terez.noble@gmail.com>
In case of read error from server during heartbeat (for example when server misses out heartbeats), we tear down the connection. Signed-off-by: Terez Nemes <terez.noble@gmail.com>
I needed to force push because of conflict |
Build SUCCESS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approve from my side.
I would like to update the PR description emphasizing that the heartbeat interval is configured, not the timeout.
Users can provide heartbeat in their configuration, that is negotiated with the server. In case heartbeat is enabled, amqp destination will send heartbeats periodically.
Heartbeat is measured in seconds. Default value is zero.
Example configuration:
Fixes: #189