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
The purpose of keepalive is to periodically send a ping packet (and check for it's response) so that both sides of the connection know when the connection fails, and they can close the old connection and try to connect again.
In the current implementation, emqtt sends the PINGREQ packet at keepalive intervals (if configured), but does not check that PINGRESP is coming correctly. So, in case the connection breaks / hangs, emqtt does not fail.
How to reproduce:
Run emqtt on local system and connect to emqx (or any other broker) running on cloud with keepalive = 10 seconds (or any low value).
Disconnect from WiFi/Network ( or simulate connection hang in some other way )
emqtt does not give connection failure even after several minutes
Expected behavior: If no ping response is received from broker after keepalive*3 seconds, disconnect from broker. Then the retry logic can try to reconnect, if configured.
The actual heartbeat timeout value can also be created as a config similar to emqx's keepalive_backoff.
The text was updated successfully, but these errors were encountered:
srijan
changed the title
Client does not disconnect from broker if keepalive ping gets no response
Client does not disconnect from broker if keepalive ping gets no response (heartbeat timeout)
May 11, 2022
The purpose of keepalive is to periodically send a ping packet (and check for it's response) so that both sides of the connection know when the connection fails, and they can close the old connection and try to connect again.
In the current implementation, emqtt sends the PINGREQ packet at
keepalive
intervals (if configured), but does not check that PINGRESP is coming correctly. So, in case the connection breaks / hangs, emqtt does not fail.How to reproduce:
Expected behavior: If no ping response is received from broker after
keepalive*3
seconds, disconnect from broker. Then the retry logic can try to reconnect, if configured.The actual heartbeat timeout value can also be created as a config similar to emqx's
keepalive_backoff
.The text was updated successfully, but these errors were encountered: