Comment 3 for bug 880863

Revision history for this message
Roger Light (roger.light) wrote :

Ah, I think I see what's happening and it should all be fixed with the addition of your line.

The persistent database file is intended to store information across restarts of the broker. That basically boils down to information about clients that have clean_session set to false as well as any retained messages. For the clients this means subscriptions and queued messages. If you have clean_session set to true you shouldn't be seeing them in the persistent database. The broker writes the file every 1800 seconds (as configured in mosquitto.conf) or when it is stopped. It isn't a direct representation of what's in memory though.

Assuming you're using clean_session=false, what will most likely be happening is that you have the broker running and your client connects. If you connect another client with the same id but with a different keepalive value you should see it keep the original keepalive value because of the missing line.

If you now restart the broker, the client details will be written to disk - but this doesn't include keepalive because it's not a persistent piece of data because you have to provide it when you connect. When the broker restarts it loads the stored client information but not the keepalive because it doesn't exist - so the default of 60 seconds is used. When your client connects it is effectively treated as a duplicate client and doesn't get the new keepalive because of the missing line.

If you can confirm that you're using clean_session=false I'll be fairly happy that all of the above is true.

Keeping the db file from 0.12 shouldn't make any difference. The format changed very slightly from 0.12 to 0.13 but 0.13 can read in the older versions.