From f148d7b7912709db6d77702a843d47acca188a54 Mon Sep 17 00:00:00 2001 From: Zahi Kakish Date: Tue, 17 Mar 2026 13:43:39 -0600 Subject: [PATCH 1/2] fixed executor issue using wrong task attribute and implementation call Signed-off-by: Zahi Kakish --- synchros2/synchros2/executors.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/synchros2/synchros2/executors.py b/synchros2/synchros2/executors.py index bf79212..cb65d52 100644 --- a/synchros2/synchros2/executors.py +++ b/synchros2/synchros2/executors.py @@ -670,6 +670,10 @@ def bind(self, callback_group: rclpy.callback_groups.CallbackGroup, thread_pool: self._logger.debug(f"Binding {callback_group_name} to thread pool #{thread_pool_index}...") self._callback_group_affinity[callback_group] = thread_pool + def _spin_once_impl(self, *args: typing.Any, **kwargs: typing.Any) -> None: + """Spin the executor once (for Jazzy and beyond).""" + self._do_spin_once(args, kwargs) + def _do_spin_once(self, *args: typing.Any, **kwargs: typing.Any) -> None: with self._spin_lock: try: @@ -787,9 +791,15 @@ def shutdown(self, timeout_sec: typing.Optional[float] = None) -> bool: with self._spin_lock: # rclpy.executors.Executor base implementation leaves tasks # unawaited upon shutdown. Do the housekeepng. - known_tasks = [ - AutoScalingMultiThreadedExecutor.Task(task, entity, node) for task, entity, node in self._tasks - ] + list(self._work_in_progress) + if hasattr(self, "_tasks"): # ROS 2 Humble + known_tasks = [ + AutoScalingMultiThreadedExecutor.Task(task, entity, node) for task, entity, node in self._tasks + ] + list(self._work_in_progress) + else: # ROS 2 Jazzy and beyond + known_tasks = [ + AutoScalingMultiThreadedExecutor.Task(task, task_data.source_entity, task_data.source_node) + for task, task_data in self._pending_tasks.items() + ] + list(self._work_in_progress) for task in known_tasks: task.cancel() return done From 87e9f4ad900fd3c28683ae119db33ca74da5d09f Mon Sep 17 00:00:00 2001 From: Zahi Kakish Date: Wed, 18 Mar 2026 17:38:48 -0600 Subject: [PATCH 2/2] added missing packing and kwargs operators Signed-off-by: Zahi Kakish --- synchros2/synchros2/executors.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synchros2/synchros2/executors.py b/synchros2/synchros2/executors.py index cb65d52..2eb02a3 100644 --- a/synchros2/synchros2/executors.py +++ b/synchros2/synchros2/executors.py @@ -672,7 +672,7 @@ def bind(self, callback_group: rclpy.callback_groups.CallbackGroup, thread_pool: def _spin_once_impl(self, *args: typing.Any, **kwargs: typing.Any) -> None: """Spin the executor once (for Jazzy and beyond).""" - self._do_spin_once(args, kwargs) + self._do_spin_once(*args, **kwargs) def _do_spin_once(self, *args: typing.Any, **kwargs: typing.Any) -> None: with self._spin_lock: