You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"If a peer detects no incoming
traffic (i.e. received octets) for two heartbeat intervals or longer, it should close the connection without
following the Connection.Close/Close-Ok handshaking, and log an error."
async def _heartbeat_sender(self) -> None:
if self._heartbeat == 0:
return
while True:
await self.send_frame(schema.Heartbeat())
await asyncio.sleep(self._heartbeat)
if time.monotonic() - self._last_heartbeat > self._heartbeat * 2:
logger.warning("Heartbeats from server missing") # no connection close, only log
If I understood correctly, then the server should close the connection at this point, why does it not do this?
I have a guess as to why this is so. If the tcp connection is dead, then the rabbitmq server should also detect the absence of heartbeats and close the connection, right?
The text was updated successfully, but these errors were encountered:
Thank you, @nesb1, for reporting the issue.
The client should close the connection after not receive X heartbeats.
We have to analyse it. We can't guarantee an ETA since we are busy on something else at the moment.
Hi @nesb1 I think we can close the client at that point, maybe after two heartbeats get missed from the server like the other clients are doing. The fact is that we need to find a way to be able to notify the caller in order allow proper cleanup (for example closing the producer) or allow other final operations to be finalized. The issue is that at the moment the connection_closed_handler is managed differently from Producer and Consumer. In case of Consumer should be implemented and passed by the caller while in case of Producer is the one defined in producer.py (_on_connection_closed). This diversion of flow at moment can create some issue. This is maybe not a top priority at the moment for the library, but if you like to improve this heartbeat management feel free to open a PR!
In AMQP specification stated about actions on missing heartbeats:
"If a peer detects no incoming
traffic (i.e. received octets) for two heartbeat intervals or longer, it should close the connection without
following the Connection.Close/Close-Ok handshaking, and log an error."
In a code I found this situation handler
If I understood correctly, then the server should close the connection at this point, why does it not do this?
I have a guess as to why this is so. If the tcp connection is dead, then the rabbitmq server should also detect the absence of heartbeats and close the connection, right?
The text was updated successfully, but these errors were encountered: