Polyconseil / aioamqp

AMQP implementation using asyncio
Other
280 stars 88 forks source link

Bcz/client heartbeat #59

Closed dzen closed 8 years ago

dzen commented 8 years ago

This PR deals with two things

dzen commented 8 years ago

Sadly the build failed on a doc commit :o it's hard to debug without the rabbitmq logs :(

dzen commented 8 years ago

@smurfix any though on those commits ? :p

dzen commented 8 years ago

From the documentation:

Heartbeat frames are sent about every timeout / 2 seconds. 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.

for now this code only wait_for timeout=server_heartbeat. we should probably wait for a timeout of server_heartbeat * 2.

Or we will have undesirable behaviour.

dzen commented 8 years ago

When I set a 50second hearbeat, a debug prints:

received HEARTBEAT frame at 2015-12-03 12:26:53.443308 received HEARTBEAT frame at 2015-12-03 12:27:43.445315 received HEARTBEAT frame at 2015-12-03 12:28:33.447371 received HEARTBEAT frame at 2015-12-03 12:29:23.449460 received HEARTBEAT frame at 2015-12-03 12:30:13.451342 received HEARTBEAT frame at 2015-12-03 12:31:03.453358

what if we checks for HEARTBEAT *2 ? :D