eclipse-mosquitto / mosquitto

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

Mosquitto is not publishing all received message (since Mosquitto 2.0.16) #3056

Open D-r-P-3-p-p-3-r opened 5 months ago

D-r-P-3-p-p-3-r commented 5 months ago

I am experiencing a loss of MQTT messages in the broker (with Mosquitto 2.0.18). What I noticed at first is that clients that had subscribed to a certain topic (QoS 0 or QoS 2) did not receive all messages that were published (QoS 2, not retained) from another client to that topic. After creating network traces I could see that all messages arrived at the broker but some of them were not published. It seems to happen when another publish is received before a previous one was released/completed. I did not experience the problem with Mosquitto 2.0.12.

Setup to reproduce

I added two screenshots from network traces that illustrate the problem:

Edit: The error was introduced in 2.0.16. In 2.0.15 everything still worked fine.

SVH-Powel commented 5 months ago

Could you try to configure the buffer?

https://github.com/eclipse/mosquitto/issues/2887#issuecomment-2135030270

D-r-P-3-p-p-3-r commented 5 months ago

We're using max_queued_messages 200 atm. In the test scenario exactly 3 messages are sent. Thus, 200 should be enough, no?

sounddoor commented 1 month ago

I am using Mosquitto 2.0.18 and have also encountered this issue. I have enabled all logging modes. I send out commands, but there are no logs indicating forwarding; sometimes, forwarding does occur.

2024-09-03T14:51:30: Received PUBLISH from mobile_20335640-643e-11ef-be39-3f8fc6edf344 (d0, q2, r0, m14994, 'BBQ/806599c66590d71b/ctrl', ... (27 bytes))
2024-09-03T14:51:30: Sending PUBREC to mobile_20335640-643e-11ef-be39-3f8fc6edf344 (m14994, rc151)
2024-09-03T14:51:31: Received PUBREL from mobile_20335640-643e-11ef-be39-3f8fc6edf344 (Mid: 14994)
2024-09-03T14:51:31: Sending PUBCOMP to mobile_20335640-643e-11ef-be39-3f8fc6edf344 (m14994)