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
Will message not published when disconnecting an already connected client #1946
Comments
Thanks @rpiper. I'm not sure whether your suggestions is quite right for all cases. If a client has set a will delay interval, for instance, I do not believe the Will should be sent unconditionally. Leave it with me, I'll get it fixed for 2.0.3. |
This was not happening for the case when the existing session wasn't being continued. Closes #1946. Thanks to Rory Piper.
I believe this is now fixed in the |
@ralight This fixes the issue. I have confirmed that the Will from previous connections is being published when the client reconnects with |
This was not happening for the case when the existing session wasn't being continued. Closes eclipse#1946. Thanks to Rory Piper.
I'm testing MQTT Sparkplug B protocol using mosquitto broker, and I noticed that the Will message for clients is not being published by the broker when it disconnects an already connected client on reconnect. Sparkplug relies on Will message to indicate the end of a data session.
If a client connects with a Will message, then a second client connects with the same client Id as the first client, mosquitto is correctly closing the first connection, but it is not publishing the Will message of the first client.
The device I'm testing with is battery powered, and I can reproduce the bug by cycling power to the client while it is connected to the broker. When the client reconnects, mosquitto closes the old connection but does not publish the Will for the first connection.
I managed to fix the issue in my working copy with this one-line change to handle_connect.c:167
The text was updated successfully, but these errors were encountered: