Description
After updating mosquitto to v2.0.21 I get my clients randomly disconnected either at:
- Connection time
- After a random time
With the following message:
1749570348: New connection from 127.0.0.1:45268 on port 8883.
1749570348: Client <unknown> has exceeded timeout, disconnecting.
I tested it in previous versions and it didn't happened. I have been using my mqtt clients for months without this problem.
It seems related to the new keepalive algorithm backported to v2.0.21 by @ralight. See the end of this issue: #3138.
Important: it only happens if you set a max_keepalive
value in mosquitto.conf (for my tests I use 60s). If you don't set the parameter, the error doesn't happen.
To reproduce it, set a max_keepalive
value in your mosquitto.conf and use mosquitto_pub
to send a test command. Repeat the mosquitto_pub
command a few times and the error happens approx 1 out of 10 times.
Let me know if you need more information or I can help testing. Thanks!