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
persistent_client_expiration does not work with logrotate/reload #1494
Comments
As a result those inactive clients and possible a large number of queued messages are never purged from mosquitto (and mosquitto.db) |
Other people have seen what looks like clients being disconnected on HUP, but I've never been able to reproduce it. Do you have any other mosquitto config that might be different to what I have? |
I cannot reproduce the problem of clients being disconnected on HUP using a stripped down test environment. What I can reproduce is the fact that v311 clients never expire because for v311 clients session_expiry_interval is always set to UINT32_MAX on connect and the expiration check does Probably a fix for the problem would be:
P.S. |
Good point about the UINT32_MAX value. We have to keep that as a special value though which means "never expire" - except that the custom expiration must override it. |
Closes #1494. Thanks to Christoph Krey.
This problem is in MQTTv311:
When log is rotated and mosquitto gets reloaded, inactive clients are detected as disconnected.
loop.c
outputs the following message:/var/log/mosquitto/mosquitto.log
loop.c
callscontext__disconnect
which callssession_expiry__add
whichsets the expiry for the inactive session to now + persistent_client_expiration.
If persistent_client_expiration is longer than one day, those clients will never expire...
/etc/mosquitto/mosquitto.conf
/etc/logrotate.d/mosquitto
The text was updated successfully, but these errors were encountered: