-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Keepalive causes a reconnect loop when connection is lost #1778
Comments
Humm yeah it seems to be a bug, the next disconnections seems to don't have any reason. Could you try to set the If you are able to fix this please open a PR then 🙏🏼 |
I've used log4js for the logging and prefixed mqtt logging with "mqtt". |
The strange thing I notice here is that immediatly after calling The ping timer is actually triggered (see next lines) and that causes a loop. Are you running it on nodejs or browser? |
Found the issue, fix ready in #1779 |
@robertsLando , Awesome work! |
* fix: keepalive causes a reconnect loop when connection is lost Fixes #1778 * fix: add test
@robertsLando It seems this might have broken keepalive In 5.3.5, keepalive is no longer being sent Our server closes the connection after 60s, because there are no pings Then new connection is opened |
@olso-nordsec Could you tell me your environment? NodeJS? Browser? Could you send me a reproduction script and debug logs? Open a new issue with such info please |
@robertsLando already opened a bug report here #1806 |
Sorry I was reading notifications one by one and I didn't see it |
When using the package I've noticed that the keepalive setting can cause a reconnect loop. Not sure if I misunderstand the setting or if it is bug.
How to reproduce:
Note: This only happens when the connection is lost.
output:
The code I've used:
https://codesandbox.io/p/devbox/mqtt-keepalive-bug-vr6fn5?file=%2Findex.js%3A7%2C29
Note: do not run this in the sandbox but locally otherwise the interrupt will not work. :)
The text was updated successfully, but these errors were encountered: