Disconnecting publishers/subscribers in ROS2 w DDS

734 views
Skip to first unread message

Brad Baillio

unread,
Aug 16, 2016, 9:39:39 PM8/16/16
to ROS SIG NG ROS
I've noticed that if two nodes are talking, (ie one publishing, the other subscribing) and then one of them shuts down, the other one starts spewing error messages at the DDS layer.
Here's an example output:
Node        : BradB-W
Process     : velodyne_node.exe <6304>
Thread      : recv 16840
Internals   : V6.4.140407OSS/3b83e82/3b83e82/ddsi2/ddsi_socket.c/45/0/1471396939.169089372
========================================================================================
Report      : ERROR
Date        : Tue Aug 16 19:22:19 Mountain Daylight Time 2016
Description : UDP recvmsg sock 1796: ret -1 errno 10054

 Is there a way to gracefully close subs or pubs so that these errors don't start spewing?

I've tried the rclcpp::shutdown(), but that doesn't seem to make a difference.

Thanks.

William Woodall

unread,
Sep 2, 2016, 3:10:44 PM9/2/16
to ROS SIG NG ROS
The subscribers and publishers are scoped, so letting them go out of scope is the appropriate way to shut them down and close connections.

I've seen these messages as well, and my guess is that we're not blocking on shutdown correctly so that OpenSplice can guarantee that the other side knows the connection should be terminated. It doesn't always happen, I think because it fires off a message to let the other side know, but this can fail if the program terminates before that message is sent or if that message is not delivered the program no longer exists to resend it.

By comparison shutting down a Connext backed ROS 2 application takes much longer and I think this is what it is doing behind the scenes. Though I'd need to dig into it more to be sure.

--
You received this message because you are subscribed to the Google Groups "ROS SIG NG ROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ros-sig-ng-ros+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
William Woodall
ROS Development Team
Reply all
Reply to author
Forward
0 new messages