-
Notifications
You must be signed in to change notification settings - Fork 795
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
Repeated matched event notification #3395
Comments
@Barry-Xu-2018 Thanks for the report. I think the changes on Barry-Xu-2018@baa20a2 make sense. Would you mind opening a PR with them? |
Okay. I will make a PR. |
I created a PR #3396 to fix it. |
@Barry-Xu-2018 After a colleague discovered a regression created by #3396, and we fixed it with #3418, I am revisiting this one. The behaviour you observed is the one mandated by the DDS standard:
So when using both a listener and a WaitSet for the same communication status, both should be triggered. |
@MiguelCompany Thanks for sharing information. Based on #3418, I do test on my environment. Repeat issue doesn't occur. Fast-DDS/src/cpp/fastdds/publisher/DataWriterImpl.cpp Lines 1201 to 1202 in 7123d35
|
Sorry. I find I used old test codes to do test. So I didn't find a problem. |
@Barry-Xu-2018 I guess you could ignore the event whenever |
Thank you. In callback function, we can ignore it base on your suggestion. Now, I am considering ignore repeated event. if (guard_condition.get_trigger_value()) {
active = true;
guard_condition.set_trigger_value(false);
} else {
active = fase; // I think we should not do notify while trigger value is clear.
} |
Is there an already existing issue for this?
Expected behavior
Only one matched event notification
Current behavior
Double matched event notification
Steps to reproduce
Environment is ros2 rolling.
Demos: https://github.com/Barry-Xu-2018/demos/tree/topic-add-matched-event-demo
Expected output for demo
Actual output
Fast DDS version/commit
master (commit: 0a43497)
Platform/Architecture
Ubuntu Focal 20.04 amd64, Other. Please specify in Additional context section.
Transport layer
Default configuration, UDPv4 & SHM
Additional context
After checking code, I think the below codes should be changed
Fast-DDS/src/cpp/fastdds/publisher/DataWriterImpl.cpp
Lines 1343 to 1349 in 0a43497
Not like other method process, it doesn't call get_publication_matched_status().
In get_publication_matched_status(), it will call below code to clear status.
Fast-DDS/src/cpp/fastdds/publisher/DataWriterImpl.cpp
Line 1368 in 0a43497
About 2 notification:
First notification is here
listener->on_publication_matched() will call code in rmw_fastrtps
https://github.com/ros2/rmw_fastrtps/blob/f13df4c79ed867488e607251a25c784643724a3e/rmw_fastrtps_shared_cpp/src/custom_publisher_info.cpp#L368
Second notification is here
Fast-DDS/src/cpp/fastdds/publisher/DataWriterImpl.cpp
Line 1349 in 0a43497
Finally, they will be processed at
https://github.com/ros2/rmw_fastrtps/blob/f13df4c79ed867488e607251a25c784643724a3e/rmw_fastrtps_shared_cpp/src/rmw_wait.cpp#L192-L206
I am not sure where this problem belongs to fastdds or rmw_fastrtp.
I can modify code as the below to solve this problem. But I don't confirm whether above my understanding is correct.
Barry-Xu-2018@baa20a2
XML configuration file
No response
Relevant log output
No response
Network traffic capture
No response
The text was updated successfully, but these errors were encountered: