You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: MQTT threading model and event emitter correctness (#93)
* fix: MQTT threading model and event emitter correctness
- Marshal MQTT message parse/dispatch from the AWS CRT network thread
onto the asyncio event loop; keeps the SDK callback trivial, prevents
blocking user callbacks from stalling MQTT processing, and eliminates
the handler-registry iteration race during reconnect/resubscribe
- Iterate snapshots of handler registries so handlers can
subscribe/unsubscribe during dispatch
- Isolate individual handler failures: catch Exception per handler with
logging instead of only (TypeError, AttributeError, KeyError)
- Make the unit system preference process-wide instead of a ContextVar;
tasks scheduled from CRT threads never inherited the caller's context,
so --unit-system was silently ignored for all MQTT-delivered data
- Remove once-listeners before invoking them: raising callbacks no
longer stay registered forever and concurrent emits no longer
double-fire
- Clean up wait_for() listeners in a finally block so cancellation does
not leak them; fix wait_for docstring examples that broke user code
* test: reset unit system before and after each threading-model test
Addresses review feedback: the preference is process-wide, so a
teardown-only reset let the first test in this module inherit values
set by earlier tests in the session.
---------
Co-authored-by: emmanuel <emmanuel@musta.lan>
0 commit comments