Skip to content

Conversation

@novag
Copy link
Contributor

@novag novag commented Apr 27, 2025

  • The previous aiomqtt implementation was unreliable: when the MQTT broker closed the connection, the client often failed to auto-reconnect as expected.
  • This change removes the aiomqtt wrapper and switches to using paho-mqtt directly.
  • The new implementation has been running for two weeks with no issues.

@CLAassistant
Copy link

CLAassistant commented Apr 27, 2025

CLA assistant check
All committers have signed the CLA.

@broglep
Copy link
Collaborator

broglep commented Apr 29, 2025

The new implementation could block processing of messages, so add another source for instability.
You might have been lucky not to to face any issues so far, but I suspect there are some concurrency issue in this new implementation. I think they are currently not manifesting because only sending is implemented and not receiving

When using a dedicated thread (which paho-mqtt does with loop_start()) you will end up with callbacks called on another thread then main, when handing back control to python / asyncio, you will need to make sure to properly handle this (otherwise the async code will fail)

So overall I would prefer a aiomqtt implementation, it should already do all that heavy lifting.

Any information on the issues you experienced with aiomqtt? Are you sure that it was related to aiomqtt and not paho-mqtt itself? In the long run (even more so when we plan to extend proxy to sending and receive) it might be better invested time to fix aiomqtt instead of re-implementing part of the async wrapper logic.

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

Successfully merging this pull request may close these issues.

4 participants