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
Setup publisher on a different program and repeatedly publishes data
In the test program, create MultiThreadExecutor and create a thread to spin it
Repeatedly create and destroy subscription with new MutuallyExclusiveCallbackGroup like this:
forindexinrange(100):
test_sub=rclpy_node.create_subscription(std_msgs.msg.String, '/test', self.testCB, qos_profile=1, callback_group=rclpy.callback_groups.MutuallyExclusiveCallbackGroup())
time.sleep(0.04) # Wait for some messagesrclpy_node.destroy_subscription(test_sub)
Expected behavior
Succeed without exception
Actual behavior
Traceback (most recent call last):
File "/home/test/test.py", line 41, in _spin_rclpy_executor
self.executor.spin()
File "/opt/ros/iron/lib/python3.10/site-packages/rclpy/executors.py", line 295, in spin
self.spin_once()
File "/opt/ros/iron/lib/python3.10/site-packages/rclpy/executors.py", line 813, in spin_once
self._spin_once_impl(timeout_sec)
File "/opt/ros/iron/lib/python3.10/site-packages/rclpy/executors.py", line 810, in _spin_once_impl
future.result()
File "/opt/ros/iron/lib/python3.10/site-packages/rclpy/task.py", line 94, in result
raise self.exception()
File "/opt/ros/iron/lib/python3.10/site-packages/rclpy/task.py", line 239, in __call__
self._handler.send(None)
File "/opt/ros/iron/lib/python3.10/site-packages/rclpy/executors.py", line 436, in handler
arg = take_from_wait_list(entity)
File "/opt/ros/iron/lib/python3.10/site-packages/rclpy/executors.py", line 356, in _take_subscription
with sub.handle:
rclpy._rclpy_pybind11.InvalidHandle: cannot use Destroyable because destruction was requested
Additional information
Exception seems doesn't happen if the subscription is in the default callback group.
This problem also affects node.destroy_node() of an already removed node, e.g. like this:
Bug report
Required Info:
Steps to reproduce issue
Expected behavior
Succeed without exception
Actual behavior
Additional information
Exception seems doesn't happen if the subscription is in the default callback group.
This problem also affects node.destroy_node() of an already removed node, e.g. like this:
The text was updated successfully, but these errors were encountered: