Skip to content

fix: populate reception_sequence_number and advertise sequence number features (backport #920)#923

Merged
ahcorde merged 1 commit intojazzyfrom
mergify/bp/jazzy/pr-920
Mar 11, 2026
Merged

fix: populate reception_sequence_number and advertise sequence number features (backport #920)#923
ahcorde merged 1 commit intojazzyfrom
mergify/bp/jazzy/pr-920

Conversation

@mergify
Copy link

@mergify mergify bot commented Mar 11, 2026

Description

rmw_feature_supported currently returns false for both RMW_FEATURE_MESSAGE_INFO_PUBLICATION_SEQUENCE_NUMBER and RMW_FEATURE_MESSAGE_INFO_RECEPTION_SEQUENCE_NUMBER, causing rclcpp to skip populating these fields in rclcpp::MessageInfo entirely. Additionally, reception_sequence_number is always set to 0 with a TODO comment at both take sites.

The fix:

  • Flips rmw_feature_supported to return true for both sequence number features.
  • Adds a std::atomic<uint64_t> reception_sn_ counter to SubscriptionData, initialized to 0. Each call to take_one_message or take_serialized_message increments it with fetch_add(1, std::memory_order_relaxed) and assigns the pre-increment value to message_info->reception_sequence_number.
  • publication_sequence_number was already populated from the attachment; no change needed there.

The attachment wire format (sequence_number | source_timestamp | source_gid) is unchanged — this fix is purely in the subscriber-side bookkeeping.

Closes #907
Closes #906


This is an automatic backport of pull request #920 done by [Mergify](https://mergify.com).

@ahcorde ahcorde merged commit 785ea3e into jazzy Mar 11, 2026
4 checks passed
@ahcorde ahcorde deleted the mergify/bp/jazzy/pr-920 branch March 11, 2026 10: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.

2 participants