Mosquitto: 2.0.x Persistent Client Subscription info lost after mosquitto restart [message #1861183] |
Tue, 26 September 2023 12:58  |
Eclipse User |
|
|
|
Dear Team,
This is my first post in the forum.
I am upgrading mosquitto in one of my projects from 1.6.12-4 to 2.0.1x series and was struck with one of the strange issues as described below.
Setup Details:
I have a client ABCD acting as a publisher of Topic A.
Configuration Clean Session as True,
Messages sent with QOS 1 )
I have a client PQRS acting as a subscriber of Topic A.
Clean Session False,
QOS1
Behavior with 1.6.12-4
1) When PQRS( which is acting as subscriber) disconnects, mosquito stores all the messages that are sent by client ABCD (which is acting as publisher) in the mosquitto.db as subscriber to the message is not yet finished reading the message.
2) With PQRS in disconnection state if the broker is restarted the subscription information of client PQRS is found to be still remembered as the new messages from ABCD continued to be accumulated/stored in the mosquitto.db.
Behavior with 2.0.1x
1) same as 1.6.12-4
2) With PQRS in disconnection state if the broker is restarted the subscription information of client PQRS is found to be lost and the new messages from ABCD are found to be acknowledged to client ABCD but are not stored in the mosquitto.db.
Reference:
This behavior is found to be not in line with definition of persistent client
"On connection, a client sets the "clean session" flag, which is sometimes also known as the "clean start" flag. If clean session is set to false, then the connection is treated as durable. This means that when the client disconnects, any subscriptions it has will remain and any subsequent QoS 1 or 2 messages will be stored until it connects again in the future. "
Question
Assuming that there is a behavioral difference between the 1.6.12-4 and 2.0.1x. I request you to please suggest if there is an additional setting that would make it work like before or if it is a known issue in 2.0.1x.
I have attached the mosquitto.conf files with this attachment.
The persistence is enabled in the configuration & persistent client expiry is set as 1 Year which should ideally mean the information should be retained.
Please help me in this regard.
Thanks and Regards,
[Updated on: Wed, 27 September 2023 02:13] by Moderator
|
|
|
|
|
|
|
|
|
Duplication Procedure of bug with subscriptions not honoured with SIGHUP [message #1861583 is a reply to message #1861337] |
Fri, 20 October 2023 03:55  |
Eclipse User |
|
|
|
Hello Everyone,
Please find the simplistic duplication procedure using mosquitto_sub, mosquitto_pub and mosquito.
The script runs the broker, subscriber and publisher and restarts them in a timely fashion to create the bug.
1) Sets up the environment, files
2) Brings up broker and subscriber
3) publishes a message
4) kills the subscriber
5) Kills the broker
6) Setup broker again
7) publishes a message
8) SIGHUP broker
9) Publishes around 4 messages
10) Setup subscriber
11) Kills broker and subscriber
The messages which are expected to be received by the subscriber after it changes its state from inactive to active are lost if the SIGHUP message is given to broker. We can notice that neither subscriber received the messages nor they are stored in the db.
If the step 8 is skipped then we notice that there is no issue.
Regards,
Pavan
|
|
|
Powered by
FUDForum. Page generated in 0.04929 seconds