-
Notifications
You must be signed in to change notification settings - Fork 179
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
refactor(robot-server): Interact with Paho from a single thread #16078
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for digging into this (and fixing some of my sloppier Python work)!
It's strange to me that the major MQTT library for Python doesn't document its publish
behavior as well as we'd expect. From what I can tell, these changes are safe. I think merging this kind of networking stuff into edge
as early as possible into the next dev cycle is the best move.
"""Intended to be used by endpoint functions as a FastAPI dependency.""" | ||
notification_client = _notification_client_accessor.get_from(app_state) | ||
assert ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code changes lgtm!
Overview
Closes EXEC-685. See that ticket for explanation.
Test Plan and Hands on Testing
Changelog
Review requests
Double-check my understanding of how Paho works. If I'm wrong about its
publish()
method being non-blocking, this risks stalling all of robot-server. For example, if some Paho buffer fills up, robot-server will stop responding toGET /health
requests until it's drained.Risk assessment
Low-ish, but see review requests.