Skip to content

Add rcl_subscription_options_set_acceptable_buffer_backends with proper lifetime management#1308

Merged
ahcorde merged 1 commit intorollingfrom
native_buffer/6.5-rcl
Mar 31, 2026
Merged

Add rcl_subscription_options_set_acceptable_buffer_backends with proper lifetime management#1308
ahcorde merged 1 commit intorollingfrom
native_buffer/6.5-rcl

Conversation

@nvcyc
Copy link
Copy Markdown
Contributor

@nvcyc nvcyc commented Mar 24, 2026

Description

This pull request adds rcl_subscription_options_set_acceptable_buffer_backends() to properly manage the lifetime of the acceptable_buffer_backends string in subscription options, following the same pattern used by rcl_subscription_options_set_content_filter_options().

This PR introduces the following changes:

  • New function rcl_subscription_options_set_acceptable_buffer_backends(): Allocates an owned copy of the string using rcutils_strdup() with the rcl allocator, matching the lifetime management pattern of content filter options.
  • Updated rcl_subscription_options_fini(): Frees the allocated acceptable_buffer_backends string when subscription options are finalized.

This change is part of the broader ROS 2 native buffer feature.
It addresses review feedback on ros2/rclcpp#3098.

Is this user-facing behavior change?

No. This is an internal lifetime safety improvement.

Did you use Generative AI?

Yes. Claude (claude-4.6-opus) via Cursor was used to assist with creating an initial prototype version of the changes contained in this PR.

Additional Information

This PR is a dependency for the acceptable_buffer_backends changes in:

Copy link
Copy Markdown
Contributor

@tfoote tfoote left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Copy Markdown
Contributor

@hidmic hidmic left a comment

Choose a reason for hiding this comment

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

LGTM2

@ahcorde
Copy link
Copy Markdown
Contributor

ahcorde commented Mar 26, 2026

Pulls: #1308
Gist: https://gist.githubusercontent.com/ahcorde/d8737efa4c6975ff1e49f8e6d6bae1d3/raw/4fb5352c65111b5ac429b0647d8ebecc0bb59662/ros2.repos
BUILD args: --packages-above-and-dependencies rcl
TEST args: --packages-above rcl
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/18673

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

@nvcyc
Copy link
Copy Markdown
Contributor Author

nvcyc commented Mar 30, 2026

Pulls: #1308
Gist: https://gist.githubusercontent.com/nvcyc/1a514a175642b77ac66a4902aec2aee9/raw/4fb5352c65111b5ac429b0647d8ebecc0bb59662/ros2.repos
BUILD args: --continue-on-error --packages-above-and-dependencies rcl
TEST args: --packages-above rcl
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/18700

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

…er lifetime management

Signed-off-by: CY Chen <cyc@nvidia.com>
@nvcyc nvcyc force-pushed the native_buffer/6.5-rcl branch from ca37add to 730a4ed Compare March 30, 2026 01:40
@nvcyc
Copy link
Copy Markdown
Contributor Author

nvcyc commented Mar 30, 2026

Pulls: #1308
Gist: https://gist.githubusercontent.com/nvcyc/606ab6ca1278bb55448b58c7297aaef4/raw/4fb5352c65111b5ac429b0647d8ebecc0bb59662/ros2.repos
BUILD args: --continue-on-error --packages-above-and-dependencies rcl
TEST args: --packages-above rcl
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/18702

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

Copy link
Copy Markdown
Contributor

@hidmic hidmic left a comment

Choose a reason for hiding this comment

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

LGTM

@ahcorde ahcorde merged commit 2b2d063 into rolling Mar 31, 2026
3 of 4 checks passed
@ahcorde ahcorde deleted the native_buffer/6.5-rcl branch March 31, 2026 07:27
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.

4 participants