Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_ros2_daemon and ros2 param commands #668

Closed
vatsan007 opened this issue Oct 6, 2021 · 8 comments
Closed

_ros2_daemon and ros2 param commands #668

vatsan007 opened this issue Oct 6, 2021 · 8 comments
Labels

Comments

@vatsan007
Copy link

Bug report

Required Info:

  • Operating System:
    • Debian 9 (Stretch)
  • Installation type:
    • Foxy -- Built from source
  • Version or commit hash:
  • DDS implementation:
    • Fast-RTPS
  • Client library (if applicable):
    • ros2cli, _ros2_daemon

Steps to reproduce issue

I've some ros2 nodes which are being run as a system user. These nodes work fine and all ros2cli commands like ros2 node list,
ros2 param list/get -- all work fine when run as a system user.

However, when the ros2cli commands are run as root, it is observed that _ros2_daemon is not responding properly and the CPU usage of _ros2_daemon increases to 95% and remains there. It isn't recovering. Also, all the ros2 param commands fail - with the error "Node not found".

Is this behaviour expected? Shouldn't ros2cli commands work fine even when run under root?

The only way to recover from this scenario is restart all the nodes and restart of ros2 daemon using ros2 daemon stop/start commands as system user.

@clalancette
Copy link
Contributor

In theory, that combination should all work. But we don't test on Debian Stretch, and we don't test as root, so you are kind of in uncharted territory here. That said, if you find the cause of the problem we'd be happy to review fixes for it.

@vatsan007
Copy link
Author

This issue is similar to the one reported in Issue# 598. The fix suggested in the issue thread of 598 -- fixed this issue as well.

Pasting the suggestion given in that thread for reference:
<<<<<<<<<<<<<<<<<<<<
Shared memory transport is active by default since Fast DDS v2.0.2, so I think this is related to eProsima/Fast-DDS#1750

We are currently developing a fix that should avoid this issue. It will basically detect the situation and fallback to UDP communication in that case.
<<<<<<<<<<<<<<<<<<<<

@fujitatomoya
Copy link
Collaborator

I am not sure about CPU usage of _ros2_daemon increases to 95% and remains there but the rest is related to access permission for shared memory segment. one thing you can try is to disable shared memory feature described in eProsima/Fast-DDS#1750 (comment)

@vatsan007
Copy link
Author

Thanks for the reply. Disabling shared memory feature as mentioned in eProsima/Fast-DDS#1750 - did work as I mentioned above. The high CPU usage also disappeared with the above change.

I've one more query -- What will the after-effect of the above change? Will it change the underlying transport to UDP transport for even messages going out on ROS2 channels between 2 nodes?

@fujitatomoya
Copy link
Collaborator

Will it change the underlying transport to UDP transport for even messages going out on ROS2 channels between 2 nodes?

shared memory is only effective between endpoints in localhost. so after this setting, you also will UDP transport instead of shared memory. about network connection, UDP is default setting. (i may be missing something, @IkerLuengo friendly ping.)

@vatsan007
Copy link
Author

I was talking about publish/subscribe messages on ROS2 channels between ROS2 nodes on the localhost itself. Will that also use the UDP transport with the above setting?

Thanks for the reply

@fujitatomoya
Copy link
Collaborator

Will that also use the UDP transport with the above setting?

Yes, it will use UDP.

@clalancette
Copy link
Contributor

I think the original issue was fixed/worked around, so I'm going to close this out. If there is still a problem here, please feel free to reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants