ros2 / rmw_fastrtps

Implementation of the ROS Middleware (rmw) Interface using eProsima's Fast RTPS.
Apache License 2.0
157 stars 117 forks source link

Delay lock on message callback setters #657

Closed MiguelCompany closed 1 year ago

MiguelCompany commented 1 year ago

This should fix #646 by calling get_unread_count before taking the lock on the mutex on_new_message_m_.

It provides similar fixes for the callback setter on subscriptions, services, and clients.

MiguelCompany commented 1 year ago

@MiguelCompany I think this fixes subscription problem, but the same fix should be applied to on_new_response_m_ and on_new_request_m_ as well?

@fujitatomoya You are right. I've pushed the changes and also changed the PR description accordingly

fujitatomoya commented 1 year ago

CI:

MiguelCompany commented 1 year ago

@fujitatomoya Do you think this can be merged?

fujitatomoya commented 1 year ago

@mergifyio backport humble

mergify[bot] commented 1 year ago

backport humble

✅ Backports have been created

* [#661 Delay lock on message callback setters (backport #657)](https://github.com/ros2/rmw_fastrtps/pull/661) has been created for branch `humble`