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

Delay lock on message callback setters #657

Merged
merged 3 commits into from
Jan 19, 2023

Conversation

MiguelCompany
Copy link
Contributor

@MiguelCompany MiguelCompany commented Jan 11, 2023

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.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
Copy link
Collaborator

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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?

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
@MiguelCompany MiguelCompany changed the title Delay lock on SubListener::set_on_new_message_callback. Delay lock on message callback setters Jan 16, 2023
@MiguelCompany
Copy link
Contributor Author

@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
Copy link
Collaborator

CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

@MiguelCompany
Copy link
Contributor Author

@fujitatomoya Do you think this can be merged?

@fujitatomoya fujitatomoya merged commit d109187 into ros2:rolling Jan 19, 2023
@fujitatomoya
Copy link
Collaborator

@Mergifyio backport humble

mergify bot pushed a commit that referenced this pull request Jan 19, 2023
* Delay lock on SubListener::set_on_new_message_callback.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Delay lock on ClientListener::set_on_new_response_callback.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Delay lock on ServiceListener::set_on_new_request_callback.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
(cherry picked from commit d109187)
@mergify
Copy link

mergify bot commented Jan 19, 2023

backport humble

✅ Backports have been created

jefferyyjhsu pushed a commit to irobot-ros/rmw_fastrtps that referenced this pull request Jan 19, 2023
* Delay lock on SubListener::set_on_new_message_callback.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Delay lock on ClientListener::set_on_new_response_callback.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Delay lock on ServiceListener::set_on_new_request_callback.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
fujitatomoya pushed a commit that referenced this pull request Sep 5, 2023
* Delay lock on SubListener::set_on_new_message_callback.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Delay lock on ClientListener::set_on_new_response_callback.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Delay lock on ServiceListener::set_on_new_request_callback.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
(cherry picked from commit d109187)
fujitatomoya pushed a commit that referenced this pull request Sep 5, 2023
* Delay lock on SubListener::set_on_new_message_callback.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Delay lock on ClientListener::set_on_new_response_callback.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Delay lock on ServiceListener::set_on_new_request_callback.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
(cherry picked from commit d109187)

Co-authored-by: Miguel Company <miguelcompany@eprosima.com>
@MiguelCompany MiguelCompany deleted the bugfix/646 branch June 12, 2024 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deadlock when calling get_unread_count() and destroying subscription
2 participants