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

Bugfix: Recorder discovery does not restart after being stopped #1894

Merged
merged 2 commits into from
Jan 22, 2025

Conversation

oysstu
Copy link
Contributor

@oysstu oysstu commented Jan 9, 2025

This is a bug fix for a situation when the discovery in Recorder does not restart after being stopped.

Repeated calls to start_discovery should not start additional topics discovery tasks without stop_discovery calls.

  • This was originally reported in Recorder discovery does not restart after being stopped #1893, as discovery task would not be spawned if a previous stop_discovery call was made. This only works currently because the atomic is initialized to false, thus making the "correct" choice on the first call after construction.

Repeated calls to start_discovery should not start additional topics discovery tasks without stop_discovery calls

Signed-off-by: Øystein Sture <[email protected]>
@oysstu
Copy link
Contributor Author

oysstu commented Jan 9, 2025

The can_record_again_after_stop is failing because it records one more message than expected. If discovery now works between the record calls, it makes sense that it records something else as well, e.g., rosout?

Copy link
Contributor

@MichaelOrlov MichaelOrlov left a comment

Choose a reason for hiding this comment

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

@oysstu thank you for PR and attempt to fix a wrong behavior.
The naming is hard! It seems the root cause of the issue is in unclear naming fo the variable stop_discovery_.
The logic would be more readable and much easy to understand if stop_discovery_ would be renamed to the discovery_runing_.

Could you please do such rename in the code and change conditions accordingly?

@MichaelOrlov MichaelOrlov changed the title Recorder: invert start discovery condition (fixes #1893) Bugfix: Recorder discovery does not restart after being stopped Jan 10, 2025
@oysstu
Copy link
Contributor Author

oysstu commented Jan 10, 2025

I've made the change, that should clarify the logic a lot. Any thoughts on the failing tests?

Edit: seemed to pass tests this time

@oysstu oysstu requested a review from MichaelOrlov January 13, 2025 09:30
Copy link
Contributor

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

lgtm with green CI (backport required for jazzy)

@fujitatomoya
Copy link
Contributor

Pulls: #1894
Gist: https://gist.githubusercontent.com/fujitatomoya/93c6ebe95670806a2726bdeb3399771a/raw/a9f1000e30b41bab61c31daa3415b6801c810d1f/ros2.repos
BUILD args: --packages-above-and-dependencies rosbag2_transport
TEST args: --packages-above rosbag2_transport
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/15057

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

Copy link
Contributor

@MichaelOrlov MichaelOrlov left a comment

Choose a reason for hiding this comment

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

LGTM

@MichaelOrlov MichaelOrlov merged commit b483541 into ros2:rolling Jan 22, 2025
12 checks passed
@MichaelOrlov
Copy link
Contributor

https://github.com/Mergifyio backport jazzy

Copy link

mergify bot commented Jan 22, 2025

backport jazzy

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Jan 22, 2025
* Invert start discovery condition
Repeated calls to start_discovery should not start additional topics discovery tasks without stop_discovery calls

Signed-off-by: Øystein Sture <[email protected]>

* Rename stop_discovery to discovery_running and change logic accordingly

Signed-off-by: Øystein Sture <[email protected]>

---------

Signed-off-by: Øystein Sture <[email protected]>
(cherry picked from commit b483541)
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.

3 participants