Skip to content

Fix for the flaky "can_record_again_after_stop" test#2313

Merged
MichaelOrlov merged 2 commits intorollingfrom
morlov/fix-for-can_record_again_after_stop-test
Jan 21, 2026
Merged

Fix for the flaky "can_record_again_after_stop" test#2313
MichaelOrlov merged 2 commits intorollingfrom
morlov/fix-for-can_record_again_after_stop-test

Conversation

@MichaelOrlov
Copy link
Copy Markdown
Contributor

@MichaelOrlov MichaelOrlov commented Jan 12, 2026

Description

This PR addresses undefined behaviour and possible call for the callbacks of the already deleted subscriptions after calling Recorder::Stop() API.

Note: The subscription's callbacks propagated to the executor and may still be in the executor's queue, but they will no longer be called after disabling callbacks.

Is this user-facing behavior change?

No.

Did you use Generative AI?

No.

Additional Information

This reverts commit 5a364f7.

Signed-off-by: Michael Orlov <morlovmr@gmail.com>
@MichaelOrlov MichaelOrlov changed the title Fix for can record again after stop test Fix for the "can_record_again_after_stop" test Jan 12, 2026
@MichaelOrlov MichaelOrlov marked this pull request as ready for review January 12, 2026 00:13
@MichaelOrlov MichaelOrlov changed the title Fix for the "can_record_again_after_stop" test [wip] Fix for the "can_record_again_after_stop" test Jan 12, 2026
Copy link
Copy Markdown
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. (just one minor confirmation.)

@fujitatomoya
Copy link
Copy Markdown
Contributor

Pulls: #2313
Gist: https://gist.githubusercontent.com/fujitatomoya/da3b8e2131499840bbd297b0fa92fdc8/raw/17fd7601bb08d6271b5bcb4c1b65c99ed56cee4a/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/17938

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

@MichaelOrlov
Copy link
Copy Markdown
Contributor Author

@fujitatomoya Thank you for reviewing this PR. I marked it [wip] because of unexpected test failures, which I can't explain and need to investigate.

Explicitly disable all subscription's callbacks to avoid UB and
 receiving new messages on deleted subscriptions.
Note: The callbacks propagated to the executor and may still be in the
executor's queue, but they will no longer be called after this point.

- Depends on the ros2/rclcpp#2985

Signed-off-by: Michael Orlov <morlovmr@gmail.com>
@MichaelOrlov MichaelOrlov force-pushed the morlov/fix-for-can_record_again_after_stop-test branch from 77e47f7 to b8cf1fa Compare January 21, 2026 07:31
@MichaelOrlov MichaelOrlov marked this pull request as ready for review January 21, 2026 08:22
@MichaelOrlov
Copy link
Copy Markdown
Contributor Author

Pulls: #2313
Gist: https://gist.githubusercontent.com/MichaelOrlov/50a8c12a788773064f2e1a83b764d35b/raw/17fd7601bb08d6271b5bcb4c1b65c99ed56cee4a/ros2.repos
BUILD args: --packages-above-and-dependencies rosbag2_transport rosbag2_tests
TEST args: --packages-above rosbag2_transport rosbag2_tests
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/18006

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

@MichaelOrlov MichaelOrlov changed the title [wip] Fix for the "can_record_again_after_stop" test Fix for the "can_record_again_after_stop" test Jan 21, 2026
@MichaelOrlov MichaelOrlov changed the title Fix for the "can_record_again_after_stop" test Fix for the flaky "can_record_again_after_stop" test Jan 21, 2026
@MichaelOrlov MichaelOrlov merged commit 403540e into rolling Jan 21, 2026
11 checks passed
@MichaelOrlov MichaelOrlov deleted the morlov/fix-for-can_record_again_after_stop-test branch January 21, 2026 16:02
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.

2 participants