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

Handle MQTT event loop timing out better #125

Open
samip5 opened this issue Nov 24, 2022 · 2 comments
Open

Handle MQTT event loop timing out better #125

samip5 opened this issue Nov 24, 2022 · 2 comments

Comments

@samip5
Copy link

samip5 commented Nov 24, 2022

It should more than likely restart the whole app if ERROR ruuvi2mqtt::mqtt] Eventloop error: Timeout happenes multiple times.

@tmatilai
Copy link
Owner

What happens in your network or MQTT server? 😄
I've been running this on 3 hosts for almost a year without almost any issues. 😅

I'm not sure what "restart the whole app" means inside the app itself. I guess we could try to reinitiate the MQTT connection. I can think about this at some point as I also want to add TLS support to the connection, and the latest rumqtt release added more options there.

Other option would be to just exit after enough errors, and rely on some external system or watchdog to start the app again.

@samip5
Copy link
Author

samip5 commented Nov 24, 2022

What happens in your network or MQTT server? smile

MetalLB decided to stop announcing the IP (via BGP to my router) for whatever reason and making it unreacheable for my mosquitto address. The fix was to terminate it's pods and restart mosquitto as well.
(Running inside a k8s cluster and the node hosting mosquitto went offline, oops)

I'm not sure what "restart the whole app" means inside the app itself. I guess we could try to reinitiate the MQTT connection. I can think about this at some point as I also want to add TLS support to the connection, and the latest rumqtt release added more options there.

I think it would make sense to try to reinitiate it at least if there's been multiple timeouts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants