-
Notifications
You must be signed in to change notification settings - Fork 412
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
Subscription and intra-process subscription counts are not updated in sync #668
Comments
That's not possible, they are two separate subscriptions (two separate DataWriters under the hood if using DDS). As currently stated, the expected behavior you put forward is not possible and would be a won't fix. There might other ways to address the symptom ("This behaviour causes the unit tests in test_publisher_subscription_count_api to fail occasionally."), but making them update in sync is, in my opinion, not the correct way to fix the problem, nor is it possible to implement right now. |
I agree with @wjwwood, that syncing them is not a good idea. But it shouldn't fail with get_intra_process_subscription_count, as this is not being asked to the underlying DDS "datawriter". It's obtained from the size of an internal map in the intraprocess manager, which is updated when creating the publisher and when deleting it. rclcpp/rclcpp/include/rclcpp/intra_process_manager_impl.hpp Lines 254 to 272 in b352d45
I will check later if I can repro this, and see if I can understand why sometimes the count is not being updated. |
@ivanpauno I assumed we were asking the underlying datawriter on the intra process topic. Based on what you said, my theory no longer makes sense to me... I would appreciate it if you could look into @ivanpauno (considering you also wrote the test, you might have unique insight). |
We aren't doing that, because it would return a wrong count in the case of two process with publishers and subscriber in the same topic using intraprocess comm.
I've already reproduced the issue. I'm trying to figure out what the problem is. |
* Add tests for node_options usage * Add tests for copying options arguments * Add bad argument tests for wait sets * Add tests for wait_set_get_allocator function * Add test for rcl_take_response function * Change take_request to match take_response without info * Change specific test for sequence_number * Add tests for client take failed * Remove tests already done in nominal setup * Add bad arguments tests * Add test for init returning BAD_ALLOC * Add test for client get_options * Add test for already init client * Add bad argument tests * Add basic test get_default_domain_id * Add test for rmw to rcl return code function * Add test for get_localhost_only * Add tests for localhost expected usage * Address peer review comments * Add test for env variable leading to ULONG_MAX * Change return values to enum in test * Fix rcl_get_localhost_only return value * Address peer review comments * Add unexpected value to get_localhost * Add reset_rcl_error after expected fails Signed-off-by: Jorge Perez <jjperez@ekumenlabs.com>
Bug report
Intra-process subscription count of Publisher is not updated in sync with the subscription count when intra-process communication is used.
When the
get_subscription_count()
method returns the updated count,get_intra_process_subscription_count()
may not return the updated count yet. This behaviour causes the unit tests in test_publisher_subscription_count_api to fail occasionally.Required Info:
Steps to reproduce issue
Repeat the unit test test_publisher_subscription_count_api until failure. Though this may be hard to reproduce locally, here's an instance of such a failure: https://ci.ros2.org/view/nightly/job/nightly_linux_repeated/1323/testReport/(root)/projectroot/test_publisher_subscription_count_api/
Above test logs shows that the equality conditions on
get_subscription_count()
are satisfied yet the conditions onget_intra_process_subscription_count()
are not met.Expected behavior
get_subscription_count()
andget_intra_process_subscription_count()
methods should be in sync when intra-process communication is used.Actual behavior
The methods return different results.
Additional information
The text was updated successfully, but these errors were encountered: