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
At some point, NodeClient.py will raise an exception similar to the following:
Traceback (most recent call last):
File "/home/myLocalSuperUser/ros/Issue/NodeClient.py", line 75, in<module>loop.run_until_complete(main())
File "/home/myLocalSuperUser/ros/Issue/NodeClient.py", line 67, in main
executor.spin()
File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 294, in spin
self.spin_once()
File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 795, in spin_once
self._spin_once_impl(timeout_sec)
File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 792, in _spin_once_impl
future.result()
File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/task.py", line 94, in result
raise self.exception()
File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/task.py", line 239, in __call__
self._handler.send(None)
File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 430, in handler
arg = take_from_wait_list(entity)
File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 365, in _take_client
with client.handle:
rclpy._rclpy_pybind11.InvalidHandle: cannot use Destroyable because destruction was requested
Root Cause
The issue arises because rclpy's Executor accesses node lists in a non-thread-safe manner. The problem can be seen in the following code snippets from rclpy/Executor.py:
The text was updated successfully, but these errors were encountered:
Hytac
changed the title
Thread-Safety Issue in rclpy Executor Leading to InvalidHandle Exception
Thread-Safety issue in rclpy executor leading to InvalidHandle exception
Sep 12, 2024
Bug report
Threading issue with
rclpy
when accessing node lists in a non-thread-safe manner. I've prepared a reproducible example in hereExpected Error
At some point,
NodeClient.py
will raise an exception similar to the following:Root Cause
The issue arises because
rclpy
'sExecutor
accesses node lists in a non-thread-safe manner. The problem can be seen in the following code snippets fromrclpy/Executor.py
:Example 1:
Example 2:
The text was updated successfully, but these errors were encountered: