-
Notifications
You must be signed in to change notification settings - Fork 425
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
Posible bug: spin_some
only processes one message per topic even if multiple messages are in the queue
#2655
Comments
@RaphLins thanks for creating issue. it looks like this is not expected behavior. I would like to ask you to check if the problem stays (the same behavior) with |
@fujitatomoya Thank you for the feedback.
I've checked and can confirm that the problem is also observed in both the latest |
I found Iron version has the issue, and it's unrelated to the DDS type (Cyclone DDS). After checking code, I found Executor::get_next_ready_executable() call wait_result_->next_ready_subscription(). If the subscription has messages, it will generate an any_executable. It doesn't matter how many messages there are to receive for that subscription. rclcpp/rclcpp/src/rclcpp/executor.cpp Lines 800 to 813 in f12e3c6
rclcpp/rclcpp/include/rclcpp/wait_result.hpp Lines 208 to 225 in f12e3c6
Executor::execute_any_executable() call Executor::execute_subscription(). In the processing code, it will only retrieve one message. This is my understanding; please correct me if I'm wrong. |
although this is not really user expectation described in this issue report header, this is designed behavior as @Barry-Xu-2018 explains above. @RaphLins can you use |
@fujitatomoya Yes, I believe that In my opinion it would be worth considering an update of the description of |
Bug report
Required Info:
Steps to reproduce issue
A topic is being published at a high frequency while a subscribed node calls
rclcpp::spin_some()
at a lower frequency.Expected behavior
According to its description,
rclcpp::spin_some
should execute "any immediately available work", so I would expect it to process all the available messages in the subscriber queue.Actual behavior
It only processes one message in the queue at a time, causing it to accumulate.
Additional information
The text was updated successfully, but these errors were encountered: