Is it possible to set a single peer’s HeartbeatTimeout to 0 with v7? #1774
-
Exception when setting a single peer’s HeartbeatTimeout to 0 with v7. After following the migration guide, tutorials and other suggestions made via the useful posts here, I’ve upgraded from v6 to v7. I’ve encountered the same “ArgumentOutOfRangeException” when using a HeartbeatTimeout of 0, as reported in Issue #1756. My RabbitMQ HeartbeatTimeout setup along with the results of my investigations into the issue are detailed below. What I’d like to know is whether my v6 HeartbeatTimeout setup is still possible in v7? Thanks very much for taking a look at this post. Environment: RabbitMQ v3.13.2, Erlang v26.2.4. My RabbitMQ setup with RabbitMQ.Client v6 (.NET). Client HeartbeatTimeout = 0. Result = Connection created with a HeartbeatTimeout of 60 secs. This behaviour is as described in the documentation Detecting Dead TCP Connections with Heartbeats and TCP Keepalives | RabbitMQ and below:
Note: My setup has no requirement to disable heartbeats which is why, only the client’s heartbeat is set to 0. This setup works well as every new client simply has its HeartbeatTimeout set to 0, which, when running the v6 client, always results in the new connection having a heartbeat of 60 secs. My RabbitMQ setup with RabbitMQ.Client v7 (.NET). Client HeartbeatTimeout = 0. Result = System.ArgumentOutOfRangeException: Timeout can be only be set to 'System.Threading.Timeout.Infinite' or a value > 0. (Parameter 'value'). The stack trace below directs you to the SocketFrameHandler.ReadTimeout property which is where the exception is being raised whilst trying to set the System.Net.Sockets.NetworkStream.ReadTimeout property.
v6 SocketFrameHandler.ReadTimeout property:
v7 SocketFrameHandler.ReadTimeout property:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
@justcuriousstill see #1773. It is a really questionable configuration to use, disabling heartbeats is only recommended if you use TCP keepalives instead on all hosts across your system. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the in-depth analysis. Yep, I'm working on this when I have time away from supporting RabbitMQ customers. |
Beta Was this translation helpful? Give feedback.
-
v7 now allows a client to set its Heartbeat Timeout value to 0 thanks to PR #1773. This is the same behaviour as v6 and results in the connections' Heartbeat either:
|
Beta Was this translation helpful? Give feedback.
v7 now allows a client to set its Heartbeat Timeout value to 0 thanks to PR #1773.
This is the same behaviour as v6 and results in the connections' Heartbeat either:
or