Skip to content
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

After max_queued_bytes is reached, the broker never reconnects. #2256

Open
perfeldbak opened this issue Jul 16, 2021 · 3 comments
Open

After max_queued_bytes is reached, the broker never reconnects. #2256

perfeldbak opened this issue Jul 16, 2021 · 3 comments
Labels
Component: mosquitto-broker Status: Accepted It's clear what the subject of the issue is about, and what the resolution should be. Type: Bug

Comments

@perfeldbak
Copy link

perfeldbak commented Jul 16, 2021

My setup:
Device send mqtt data to the bridge.
Mosquitto broker v 2.0.11 configured as bridge, running on Windows 10
Mosquitto broker v 2.0.7 running on Windows server 2016
All messages are send with QoS 1

Bridge conf:
max_queued_bytes 1000000
max_queued_messages 0
persistent_client_expiration 2d
sys_interval 10
autosave_interval 30
persistence true
persistence_file mosquitto.db
persistence_location c:\mosquitto
allow_anonymous true

connection bridge_test1
address serverkpi02:1884
topic logdata/# out 1
cleansession false
idle_timeout 60
keepalive_interval 10
notifications true
restart_timeout 20
start_type lazy
try_private false
Broker v. 2.0.7 conf:
max_inflight_messages 0
max_queued_messages 1000000
persistent_client_expiration 1d
listener 1884
autosave_interval 300
persistence true
persistence_file mosquitto.db
persistence_location c:/mosquitto

I test by enabling a firewall rule that does not allow connection to the port. (1884)
If the bridge loses the Internet connection (enable the firewall rule) to the other broker, then data is buffered in memory, and if the Internet connection is established before memory reaches max_queued_bytes (1000000), then all buffered datas are sent.
However, if the Internet connection is not established until max_queued_bytes is reached, it will never send any data. I have to stop the broker, remove the persistent file and restart the broker.

It looks like the broker never reconnect again, if the memory usages is above max_queued_bytes

@ralight
Copy link
Contributor

ralight commented Aug 21, 2021

The conflict here is with max_queued_bytes and the lazy reconnect threshold. If you swap to normal bridge mode then it should start working again, and I'll see about fixing the lazy operation.

@ralight ralight added Component: mosquitto-broker Status: Accepted It's clear what the subject of the issue is about, and what the resolution should be. Type: Bug labels Aug 21, 2021
@perfeldbak
Copy link
Author

Thanks - it works :-) Thats fine for me.

@houcine118
Copy link

even after getting rid of the lazy start I faced similar issues. after so many tests with different configurations, I found that setting max_queued_messages to 0 caused bugs. and when set to a large enough number (in my case 1.000.000.000) it worked fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: mosquitto-broker Status: Accepted It's clear what the subject of the issue is about, and what the resolution should be. Type: Bug
Projects
None yet
Development

No branches or pull requests

3 participants