Repository navigation
Thread safe node.destroy_* - #319
Conversation
7ba0972 to
0e8cda0
Compare
|
I think I have to include # In another thread an executor is spinning
# srv destruction delayed because executor is waiting on service
node.destroy_service(srv)
# node is destroyed instantly; service still not destroyed because it's being used by executor
node.destroy_node()
# When executor shuts down the service is no longer being used, so it's destroyed
# since the node was destroyed first the service will segfault in rmw_fastrtps
executor.shutdown()I'm thinking of chaining handles so that |
c6e3e8c to
3ac25ce
Compare
3ac25ce to
5bea9ba
Compare
Publisher now uses Handle pub.publisher_handle -> pub.handle Added test for publisher destruction Added rclpy_publisher_t to replace rcl_publisher_t Signed-off-by: Shane Loretz<[email protected]> Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
Client now uses Handle Client.client_handle and client_pointer replaced by client.handle rclpy_destroy_entity no longer destroy's clients Added test for client destruction Client capsule uses rclpy_client_t instead of rcl_client_t Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
052b0ed to
e4ca965
Compare
| self._guard_condition = gc | ||
| self._guard_condition_handle = gc_handle | ||
| self._guard = GuardCondition( | ||
| callback=None, callback_group=None, context=self._context) |
There was a problem hiding this comment.
Reusing GuardCondition to reuse executor code that uses guard_condition.handle
Signed-off-by: Shane Loretz <[email protected]>
clalancette
left a comment
There was a problem hiding this comment.
Partial review with some feedback on parts I know :). Will do some additional review after.
Signed-off-by: Shane Loretz <[email protected]>
clalancette
left a comment
There was a problem hiding this comment.
All right, a few more review comments, mostly phrased as questions as I'm still getting a handle on how this works (pun intended).
| return True | ||
| if publisher in self.publishers: | ||
| self.publishers.remove(publisher) | ||
| publisher.destroy() |
There was a problem hiding this comment.
For all of these destroy calls, do we need to check for the InvalidHandle exception? Is that a case that can happen?
There was a problem hiding this comment.
It is. Maybe this should catch it and return False?
There was a problem hiding this comment.
Yeah, that seems reasonable.
There was a problem hiding this comment.
destroy_<entity>() catch InvalidHandle and return False in e630404
Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
clalancette
left a comment
There was a problem hiding this comment.
The code looks good to me now, so I'll approve.
My only remaining question is whether we should open an issue for reducing the complexity here by introducing rmw_shutdown_but_not_fini for a future enhancement. Thoughts on that?
I've gone back and forth between writing the issue on |
Original PR #319 by sloretz Original: ros2/rclpy#319
Merged from original PR #319 Original: ros2/rclpy#319
Original PR #319 by sloretz Original: ros2/rclpy#319
Merged from original PR #319 Original: ros2/rclpy#319
Follow up to #318 and #330. This PR applies the changes done to
Subscriptionto the rest of the entities on the node so they can all be destroyed safely.Not done in this PR. These might require a change to the waitable API.