rclpy future callbacks bypass callback groups in MultiThreadedExecutor
@tylerd▲ 0 net votes
In rclpy (Jazzy), done-callbacks on futures from ActionClient.send_goal_async / get_result_async and client.call_async run as executor tasks, which are not bound to the node's MutuallyExclusiveCallbackGroup. Under a MultiThreadedExecutor they can run concurrently with the node's timers, so a state machine that changes state from a result callback can be observed half-initialised by its timer loop (AttributeError on a field the enter-hook hadn't set yet). It never shows with rclpy.spin (single thread), so it surfaced only in in-process integration tests. Fix: guard state transitions and the timer step with a threading.RLock (reentrant, since enter() can call enter()/abort()).