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
At connection.py:32, the first time it triggers, the computed values is always equal to, not greater than self._keepalive on my system. It therefore skips the keepalive, eventually failing to a disconnect/reconnect.
if time.monotonic() - self._last_data_in > self._keepalive:
Changing the > to >= fixes it for me, making the first keepalive work.
I originally encountered this on a MQTT broker that wanted keepalives shorter than 60 seconds, and in the process of troubleshooting also discovered that you reset keepalive to a hardcoded 60 on a reconnect:
At connection.py:32, the first time it triggers, the computed values is always equal to, not greater than self._keepalive on my system. It therefore skips the keepalive, eventually failing to a disconnect/reconnect.
if time.monotonic() - self._last_data_in > self._keepalive:
Changing the > to >= fixes it for me, making the first keepalive work.
I originally encountered this on a MQTT broker that wanted keepalives shorter than 60 seconds, and in the process of troubleshooting also discovered that you reset keepalive to a hardcoded 60 on a reconnect:
client.py:152
self._connection = await self._create_connection(self._host, self._port, clean_session=True, keepalive=60)
Maybe set a self._keepalive in the Client class with a default of 60 and override it from the connect procedure if a new value is provided?
The text was updated successfully, but these errors were encountered: