eclipse / mosquitto

Eclipse Mosquitto - An open source MQTT broker
https://mosquitto.org
Other
8.93k stars 2.37k forks source link

Mosquitto database growing endlessly while using bridge #2647

Open SLelong opened 1 year ago

SLelong commented 1 year ago

Platform: Ubuntu Mosquitto version : 2.0.15, but the issue is also observed in previous versions.

Initial condition

Action connection between the local mosquitto broker and the bridge is lost.

Observed result: When connection is lost, the database is growing and growing. When connection comes back, The size doesn't decrease as messages are transmitted to the other bridge. Most of the messages remain in the database even if they have been transmitted. Sporadically, the database can decrease, but the general direction is to increase. This behaviour is even more visible when the mosquitto service is restarted with "systemctl restart mosquitto.service". In this case, the database is growing at each restart.

Expected result: The database should be emptied when messages are transmitted to the bridge.

bdonnette commented 1 year ago

Taking over this issue opened by a fellow colleague.

My next step should be to set up an environment reproducing the issue and make it possible for sharing. Yet he's reproduced it in a simplified environment, this should not be too long. In the meantime can anyone tell if there's obviously something in what we describe that shouldn't be done this way ?

karlp commented 1 year ago

I'd use the db_dump tool to actually look at the db, and see if there's any extra clients you may have forgotten about?

bdonnette commented 1 year ago

It's on the target side we experience the issue, and my colleague set up a fairly unitary test on this. I'll remake his bench to get the maximum information out of it still.