ros2 / rmw_connextdds

ROS 2 RMW layer for RTI Connext DDS Professional and RTI Connext DDS Micro.
Apache License 2.0
48 stars 33 forks source link

RMW API calls hang in service request callback #124

Open emersonknapp opened 1 year ago

emersonknapp commented 1 year ago

System Info

Bug Description

When a service callback is registered with rcl_service_set_on_new_request_callback, if rmw_take is called within that callback, a deadlock occurs and the program hangs.

Expected Behavior

Either the API allows this behavior and it works, or it is explicitly disallowed and returns an error code.

How to Reproduce

Run the test in https://github.com/ros2/rcl/pull/1081

Workarounds

https://github.com/ros2/rmw_connextdds/pull/123 fixes the problem from what I can tell, but I'm not 100% sure it's a good idea

emersonknapp commented 1 year ago

@asorbini - maybe you could take a look and see what you think about the problem / proposed fix. You can see my investigation at https://github.com/ros2/rcl/pull/1052#discussion_r1234648101 where I figured out the issue, shows stack traces.

emersonknapp commented 1 year ago

@asorbini could you take a look at this?