Fix content filtering on Windows with modern Connext DDS#226
Fix content filtering on Windows with modern Connext DDS#226mjcarroll wants to merge 3 commits intoros2:rollingfrom
Conversation
1. Fix a bug in writer-side filtering where it assumed the built-in SQL filter returned a discontiguous sequence of cookies. Fallback to taking addresses of contiguous cookies if necessary. 2. Disable RMW_CONNEXT_BUILTIN_CFT_COMPATIBILITY_MODE on Windows for Connext 6.0+ to enable serialized evaluation and internal registration, which is required for correct filtering of ROS 2 samples. Assisted-by: Gemini CLI:2.0-Flash
…Windows Modern RTI Connext headers (6.0.0+) already provide this declaration. Re-declaring it manually causes linkage errors on MSVC. Assisted-by: Gemini CLI:2.0-Flash
RMW_CONNEXT_DDS_API_PRO_LEGACY is always defined (defaults to 0), so #if defined() was always true. Switching to #if value ensures correct skipping on modern Connext. Assisted-by: Gemini CLI:2.0-Flash
|
Pulls: #226 |
fujitatomoya
left a comment
There was a problem hiding this comment.
lgtm, @fgallegosalido can you take a look?
|
It looks good to me. I just have one question. Has the bug in the cookie handling actually happened while investigating this issue? I checked internally and that buffer is going to always be discontiguous (a buffer of pointers to Maybe, we can add a comment above that check explaining that the buffer is always going to be discontiguous. Thank you very much @mjcarroll for looking into this! |
Description
This PR fixes Content Filtering on Windows when using modern versions of RTI Connext DDS (6.x and 7.x).
The Problem
Previously, the
rmw_connextddsimplementation on Windows was forced into a "Compatibility Mode." This mode:This led to failures in
rcl,rclcpp, andrcl_actiontests where samples were received by subscribers despite being explicitly filtered out by SQL expressions.The Fix
CMakeLists.txtto only enableRMW_CONNEXT_BUILTIN_CFT_COMPATIBILITY_MODEon Windows for Connext versions older than 6.0.0. For modern versions, we now use the internalregister_contentfilterIAPI, which supports evaluation on CDR-serialized samples.custom_sql_filter.hppto use the official RTI declaration ofregister_contentfilterI(available in modern headers) to avoid linkage errors on MSVC.RTI_CustomSqlFilter_writer_evaluated_resultwhere it assumed RTI's built-in filter always returned a discontiguous sequence of cookies. It now correctly handles both contiguous and discontiguous sequences.Verification
Verified on Windows using a targeted CI run with Connext 7.7.0. All content filtering tests in
rcl,rclcpp, andrcl_actionpassed.CI Result (Windows 10, Connext 7.7.0): https://ci.ros2.org/job/ci_windows/27743/
Is this user-facing behavior change?
No, it fixes a regression in existing functionality.
Did you use Generative AI?
Yes. Gemini CLI:2.0-Flash [web_fetch, run_shell_command, replace, git, gh]