chore: finish MOTION→Motion casing + fix telemetry shutdown race#59
Open
boringethan wants to merge 2 commits into
Open
chore: finish MOTION→Motion casing + fix telemetry shutdown race#59boringethan wants to merge 2 commits into
boringethan wants to merge 2 commits into
Conversation
Three stragglers from the earlier MOTIONInterface -> MotionInterface rename: two API docstrings (ConsoleTelemetry.py poller header, MotionConsole.ping) and CLAUDE.md (facade table, call graph, signal fallback name, demo-mode example). The script tree in scripts/ still imports MOTIONInterface from a module path that no longer exists; that's tracked as a separate dead-code triage. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
MotionConsole._drive_disconnecting() previously set state to
DISCONNECTING first, then asked the telemetry poller to stop. The
poll thread could be mid-tick when state flipped — its next UART
command-method call would see `not is_connected()`, raise
ValueError("Console controller not connected"), and the
ValueError-catch-log-reraise blocks scattered through MotionConsole
(40 sites) would surface that as ERROR before ConsoleTelemetry's
_read_all could demote it to INFO. Symptom on every clean shutdown:
ERROR - openmotion.sdk.Console - ValueError: Console controller not connected
WARNING - bloodflow-app.connector - Telemetry poll error: Console controller not connected
Reordering: stop the poller first (joins the poll thread; the
final tick, if any, runs against a still-CONNECTED state and
completes cleanly), then flip to DISCONNECTING, close UART, flip
to DISCONNECTED. Listeners still get notified at the same state
transitions; only the internal cleanup order changes.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MOTIONInterface/MOTIONConsole→Motion*casing on stale docstring refs inConsoleTelemetry.py,MotionConsole.py, and the table/call-graph/demo-mode example inCLAUDE.md.MotionConsole._drive_disconnecting()to stop the telemetry poller before flipping state toDISCONNECTING. Old order let the poll thread's in-flight tick race the state change, which surfaced asERROR: ValueError: Console controller not connectedfrom one of the 40except ValueError: log+reraiseblocks inMotionConsoleon every clean shutdown.Test plan
py_compileclean (verified locally)pip install -e <this branch>) and confirm the shutdown log no longer containsConsole controller not connected(the original smoketest in the bloodflow-app PR imported fromnext-nextSDK so this fix wasn't exercised end-to-end yet)🤖 Generated with Claude Code