ros2 / ros2cli

ROS 2 command line interface tools
Apache License 2.0
166 stars 158 forks source link

Add timeout fundamentals for daemon client communication #886

Open cottsay opened 4 months ago

cottsay commented 4 months ago

This PR is more of a proof-of-concept than a concrete proposal.

If there is a broken ROS 2 daemon process or another completely unrelated TCP server listening on the corresponding XMLRPC port, it's possible for calls like is_daemon_running to hang for a VERY long time.

For example:

You can see the XMLRPC request on the server, but without a response, the call to ros2 daemon status will just sit there. I'm not sure how long it will go before the "global default" timeout will kick in, but I haven't waited long enough to see it.

This can be a particularly bad problem in this package's tests, many of which connect to and sometimes create and destroy daemon processes. It would be nice if those tests didn't hang.

Possible mitigation for problems like #610 and #737