Skip to content

Fix serialized takes dropping the sample after an ignored one - #975

Merged
ahcorde merged 1 commit into
ros2:rollingfrom
tobdub:fix/serialized-take-buffer-reuse
Nov 20, 2026
Merged

ahcorde merged 1 commit into
ros2:rollingfrom
tobdub:fix/serialized-take-buffer-reuse

Conversation

@tobdub

@tobdub tobdub commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

TypeSupport::deserialize() reserves the take buffer, which only works on an empty FastBuffer. When a take loop skipped a sample, for example a local one with ignore_local_publications, the next sample in that loop failed to deserialize, and Fast DDS dropped it. Release the buffer before reserving it.

Generated-by: Anthropic Claude Code with Claude Opus 5.5 (claude-opus-5-5)

Description

Serialized takes lose the sample that follows an ignored local sample (ignore_local_publications). The take loop reuses its FastBuffer, but FastBuffer::reserve() only allocates into an empty buffer, so deserializing the next sample fails and Fast DDS drops it.

This releases the buffer in TypeSupport::deserialize() before reserving it, and adds tests that fail without the fix.

Is this user-facing behavior change?

Did you use Generative AI?

Yes, Claude Opus 5.5.

Additional Information

The bug came in with #823.

TypeSupport::deserialize() reserves the take buffer, which only works
on an empty FastBuffer. When a take loop skipped a sample, for example
a local one with ignore_local_publications, the next sample in that
loop failed to deserialize, and Fast DDS dropped it. Release the buffer
before reserving it.

Generated-by: Anthropic Claude Code with Claude Opus 5.5 (claude-opus-5-5)
Signed-off-by: Tobias Dubois <[email protected]>
@tobdub
tobdub force-pushed the fix/serialized-take-buffer-reuse branch from d02e921 to d4bf4ed Compare November 18, 2026 21:01

@fujitatomoya fujitatomoya left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm, i think this is good catch.

Note

THIS NEED TO BE BACKPORTED TO DOWNSTREAM.

@ahcorde

ahcorde commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Pulls: #975
Gist: https://gist.githubusercontent.com/ahcorde/5563af555bbc7012d69462a6e9ad297e/raw/2cfa82ea15f80500d0423af7e57c3e8e808c35a9/ros2.repos
BUILD args: --packages-above-and-dependencies rmw_fastrtps_cpp
TEST args: --packages-above rmw_fastrtps_cpp
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/21192

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

@ahcorde
ahcorde merged commit 91b33be into ros2:rolling Nov 20, 2026
3 checks passed
@ahcorde

ahcorde commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

@Mergifyio backport lyrical kilted jazzy humble

@mergify

mergify Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

backport lyrical kilted jazzy humble

✅ Backports have been created

Details

Cherry-pick of 91b33be has failed:

On branch mergify/bp/lyrical/pr-975
Your branch is up to date with 'origin/lyrical'.

You are currently cherry-picking commit 91b33be.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   rmw_fastrtps_cpp/test/test_take_serialized.cpp
	modified:   rmw_fastrtps_shared_cpp/src/TypeSupport_impl.cpp

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	deleted by us:   rmw_fastrtps_cpp/test/CMakeLists.txt

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

Cherry-pick of 91b33be has failed:

On branch mergify/bp/kilted/pr-975
Your branch is up to date with 'origin/kilted'.

You are currently cherry-picking commit 91b33be.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   rmw_fastrtps_cpp/test/test_take_serialized.cpp
	modified:   rmw_fastrtps_shared_cpp/src/TypeSupport_impl.cpp

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	deleted by us:   rmw_fastrtps_cpp/test/CMakeLists.txt

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

Cherry-pick of 91b33be has failed:

On branch mergify/bp/jazzy/pr-975
Your branch is up to date with 'origin/jazzy'.

You are currently cherry-picking commit 91b33be.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   rmw_fastrtps_cpp/test/test_take_serialized.cpp

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	deleted by us:   rmw_fastrtps_cpp/src/rmw_fastrtps_shared_cpp/TypeSupport_impl.cpp
	deleted by us:   rmw_fastrtps_cpp/test/CMakeLists.txt

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

Cherry-pick of 91b33be has failed:

On branch mergify/bp/humble/pr-975
Your branch is up to date with 'origin/humble'.

You are currently cherry-picking commit 91b33be.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   rmw_fastrtps_cpp/test/test_take_serialized.cpp

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	deleted by us:   rmw_fastrtps_cpp/src/rmw_fastrtps_shared_cpp/TypeSupport_impl.cpp
	deleted by us:   rmw_fastrtps_cpp/test/CMakeLists.txt

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

fujitatomoya added a commit that referenced this pull request Nov 21, 2026
Pick up #966, #962 and #975 so that the test_rosidl_buffer tests added by
ros2/system_tests#615 and #613 pass on this branch.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
ahcorde added a commit that referenced this pull request Nov 23, 2026
#975) (#982)

TypeSupport::deserialize() reserves the take buffer, which only works
on an empty FastBuffer. When a take loop skipped a sample, for example
a local one with ignore_local_publications, the next sample in that
loop failed to deserialize, and Fast DDS dropped it. Release the buffer
before reserving it.

Generated-by: Anthropic Claude Code with Claude Opus 5.5 (claude-opus-5-5)
(cherry picked from commit 91b33be)

Signed-off-by: Alejandro Hernandez Cordero <[email protected]>
Co-authored-by: tobdub <[email protected]>
Co-authored-by: Alejandro Hernandez Cordero <[email protected]>
ahcorde added a commit that referenced this pull request Nov 23, 2026
#975) (#981)

TypeSupport::deserialize() reserves the take buffer, which only works
on an empty FastBuffer. When a take loop skipped a sample, for example
a local one with ignore_local_publications, the next sample in that
loop failed to deserialize, and Fast DDS dropped it. Release the buffer
before reserving it.

Generated-by: Anthropic Claude Code with Claude Opus 5.5 (claude-opus-5-5)

(cherry picked from commit 91b33be)


Signed-off-by: Alejandro Hernandez Cordero <[email protected]>
Co-authored-by: tobdub <[email protected]>
Co-authored-by: Alejandro Hernandez Cordero <[email protected]>
ahcorde added a commit that referenced this pull request Nov 23, 2026
#975) (#980)

TypeSupport::deserialize() reserves the take buffer, which only works
on an empty FastBuffer. When a take loop skipped a sample, for example
a local one with ignore_local_publications, the next sample in that
loop failed to deserialize, and Fast DDS dropped it. Release the buffer
before reserving it.

Generated-by: Anthropic Claude Code with Claude Opus 5.5 (claude-opus-5-5)

Signed-off-by: Tobias Dubois <[email protected]>
(cherry picked from commit 91b33be)

Signed-off-by: Alejandro Hernandez Cordero <[email protected]>
Co-authored-by: tobdub <[email protected]>
Co-authored-by: Alejandro Hernandez Cordero <[email protected]>
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