Skip to content

Ignore repeated graph puts of the same entity - #1087

Open
mini-1235 wants to merge 1 commit into
ros2:rollingfrom
mini-1235:fix/buffer-matched-events-double-count
Open

mini-1235 wants to merge 1 commit into
ros2:rollingfrom
mini-1235:fix/buffer-matched-events-double-count

Conversation

@mini-1235

@mini-1235 mini-1235 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fixes #1086.

Buffer-aware publishers and subscriptions add themselves to the graph cache with parse_put after creation, and their liveliness token adds them again, as tokens from the same session also reach the graph cache. The entity sets deduplicate by GID, so graph queries were correct, but matched events (and the buffer discovery callbacks) were reported on both puts, while a removal is reported once. update_topic_map_for_put now ignores a put for an entity that is already in the graph.

Test: ros2/rmw_implementation#307.

Is this user-facing behavior change?

Yes. Matched events for types with uint8[] fields report the actual counts.

Did you use Generative AI?

Yes, Claude Code (Claude Opus 5.5) wrote the fix and this description. Reviewed and tested by me.

Additional Information

One publisher and two subscriptions, then one subscription removed, then a second publisher added and removed; a plain type (int8[]) and a uint8[] type with cpu and any subscriptions, either creation order, in the same process and across processes:

rolling this PR
publisher current/total with 2 subscriptions, same process 4/4 2/2
publisher with 2 subscriptions, across processes 3/3 2/2
first subscription after a second publisher 4/4 2/2
uint8[] type compared with the plain type (cpu/any × creation order × same/other process) differs in all 8 same in all 8

test_rmw_implementation passes. With a uint8[] field added to test_msgs, test_event (4 failures) and rclcpp's TestQosEvent (4 matched-event failures) pass as well.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Maurice <mauricepurnawan@gmail.com>
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.

Matched events report twice the matched count for buffer-aware message types

1 participant