-
Notifications
You must be signed in to change notification settings - Fork 41
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
Connection heartbeat arg description doesn't match implementation #91
Comments
I don't know. It seems like the documentation is right, but its hard to figure it out based on the naming of the heartbeat variable across the codebase. |
The negotiation logic is:
which accepts broker's value if user's value is |
The logic here actually doesn't send the heartbeat either way though? if self.connection._heartbeat:
if time.time() >= (self._last_heartbeat_send + 0.9 *
self.connection._heartbeat):
self.send_frame(HeartbeatFrame(self.channel_id))
self._last_heartbeat_send = time.time() |
Correct, but the broker cannot pass the value |
True, but isn't |
@vitaly-krugl note: since we deployed this change in production, we no longer get heartbeat timeouts in related services. This definitely merits further research though. |
@josegonzalez, this makes sense, because your change |
So are the docs wrong? |
@josegonzalez, yes the docs are wrong, and that's the gist of this issue. |
@vitaly-krugl so one reason we made this change was an upgrade to RabbitMQ moved the timeout from 5 minutes to 1 minute, impacting some of our longer running jobs (map and ticket processing). What you're saying makes it sound like there is an issue in our networking in regards to sending the heartbeats maybe, especially if the default of |
Hmmm, seems like us not sending heartbeats was unrelated. So then yes, the docs here are almost certainly wrong, heh. |
The
heartbeat
arg description 73cd9b1#diff-a440ae8b97ad1a5653b91743003e498aR334 isThe implementation appears to be that if user passed
heartbeat=None
, then the heartbeat value is broker-assigned; if user passedheartbeat=0
, then heartbeats would be disabled. The quoted description is the reverse of what actually happens in the code.The text was updated successfully, but these errors were encountered: