Skip to content

Use GID filtering to prevent loops (backport #834)#842

Merged
ahcorde merged 1 commit intokiltedfrom
mergify/bp/kilted/pr-834
Feb 20, 2026
Merged

Use GID filtering to prevent loops (backport #834)#842
ahcorde merged 1 commit intokiltedfrom
mergify/bp/kilted/pr-834

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Feb 20, 2026

🦟 Bug fix

Fixes #788.

Summary

As mentioned in the issue, ignore_local_publications is hardcoded to true in factory.hpp. This DDS option
filters by DDS participant, not by node. In composition, all nodes share the same DDS participant, so messages from all sibling nodes are dropped.

The proposed fix is to replace ignore_local_publications with publisher GID-based filtering. At subscription creation time, the bridge collects its own publisher GIDs on the topic. In the callback, it compares each incoming message's publisher GID against that list and skips matches. This prevents loops in bidirectional bridges while allowing messages from other composed nodes.

I think the Gz transport side (SetIgnoreLocalMessages(true)) is OK because it works at the gz::transport::Node level, not the process level, so it should work correctly.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers
  • Was GenAI used to generate this PR? If so, make sure to add "Generated-by" to your commits. (See this policy for more info.)

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by and Generated-by messages.


This is an automatic backport of pull request #834 done by Mergify.

Signed-off-by: Carlos Aguero <caguero@osrfoundation.org>
Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
(cherry picked from commit f33322a)
@mergify mergify bot requested a review from ahcorde as a code owner February 20, 2026 11:29
@mergify mergify bot mentioned this pull request Feb 20, 2026
9 tasks
@github-project-automation github-project-automation bot moved this from Inbox to In review in Core development Feb 20, 2026
@ahcorde ahcorde merged commit cf5bba4 into kilted Feb 20, 2026
7 of 8 checks passed
@ahcorde ahcorde deleted the mergify/bp/kilted/pr-834 branch February 20, 2026 12:20
@github-project-automation github-project-automation bot moved this from In review to Done in Core development Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants