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

[DO NOT MERGE]: Debugging via the Rpr job for https://github.com/ros2/rosbag2/pull/1796 #1803

Closed
wants to merge 13 commits into from

Conversation

clalancette
Copy link
Contributor

This is just using a separate PR to debug via the Rpr job. This is never meant to be merged; I'm just using the Rpr job here since I cannot reproduce the bug locally. I'll eventually close this and delete this branch.

clalancette and others added 13 commits September 4, 2024 15:40
This has almost exactly the same functionality as wait_for_condition,
except for two things:

1.  It is templated on the Timeout type.
2.  It calls rclcpp::shutdown after the loop completes.

However, neither of those is necessary; all callers to it use
a std::chrono::duration, and all of the test fixtures already
call rclcpp::shutdown.  Thus, just remove it and make all
callers use wait_for_condition instead.

Signed-off-by: Chris Lalancette <[email protected]>
That is, we really don't actually want to do a full
rclcpp shutdown here; we only want to stop spinning.
Accomplish that with an executor, and timing out
every 100 milliseconds to check if we are done yet.

Signed-off-by: Chris Lalancette <[email protected]>
Make sure it only spins as long as we haven't shutdown,
and that it wakes up every so often to check that fact.

Signed-off-by: Chris Lalancette <[email protected]>
The main reason for that is that these tests generally want
to test certain expectations around how many messages were
received.  However, if discovery takes longer than we expect,
then it could be the case that we "missed" messages at the
beginning because discovery hadn't yet completed.

Fix this by just waiting around for the recorder to get all
the subscriptions it expects before moving on with the test.

Signed-off-by: Chris Lalancette <[email protected]>
Signed-off-by: Chris Lalancette <[email protected]>
Signed-off-by: Chris Lalancette <[email protected]>
Signed-off-by: Chris Lalancette <[email protected]>
Signed-off-by: Chris Lalancette <[email protected]>
Co-authored-by: Michael Orlov <[email protected]>
Signed-off-by: Chris Lalancette <[email protected]>
That's because there is currently at least one bug
associated with spin_some in rclcpp.  However, it turns
out that we don't even need to use it, as we can just as
easily use spin() along with exec.cancel().

Signed-off-by: Chris Lalancette <[email protected]>
Signed-off-by: Chris Lalancette <[email protected]>
Copy link

mergify bot commented Sep 11, 2024

⚠️ The sha of the head commit of this PR conflicts with #1796. Mergify cannot evaluate rules on this PR. ⚠️

@clalancette
Copy link
Contributor Author

Closing this, since we found another way to reproduce.

@clalancette clalancette deleted the clalancette/debugging-rosbag2-transport branch September 12, 2024 16:24
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.

1 participant