Skip to content

Synchronize content filter changes with the executor - #1692

Open
minggangw wants to merge 2 commits into
RobotWebTools:developfrom
minggangw:fix-content-filter-synchronization
Open

minggangw wants to merge 2 commits into
RobotWebTools:developfrom
minggangw:fix-content-filter-synchronization

Conversation

@minggangw

Copy link
Copy Markdown
Member

Setting or clearing a content filter while spinning can replace the Fast DDS reader while rcl_wait() is still using it, causing a native crash.

  • Reuse the executor’s interrupt and wait-set write lock to serialize filter changes with waiting, without stopping the node or changing the public API.
  • Finalize native filter options when an update fails.
  • Remove the stop/restart workaround from the existing filter tests and add a spin(-1) regression that checks message delivery after repeated updates and clears.

Fix: #1691

Copilot AI balanced review requested due to automatic review settings November 18, 2026 06:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Native reader replacement and executor synchronization require ROS/Fast DDS runtime validation of the spin(-1) crash regression, but native tests could not be run in this review environment.

No open issues 🎉

What changed in this PR

This PR addresses #1691 by synchronizing subscription content-filter changes with the executor to prevent native crashes during spinning, without stopping the node or changing the public API.

Changes:

  • Reuse the executor interrupt and wait-set write lock for filter updates and clears.
  • Consolidate native filter-option cleanup, including failed updates, and replace manual parameter allocation with vectors.
  • Remove stop/restart workarounds from tests and add an isolated spin(-1) regression covering repeated updates, clears, and subsequent message delivery.
File Description
test/​test-subscription-content-filter.js Tests filter changes without stopping and adds infinite-spin regression coverage.
src/​shadow_node.h Exposes the executor to native subscription bindings.
src/​rcl_subscription_bindings.cpp Routes filter changes through the executor and consolidates option cleanup.
src/​handle_manager.h Declares the reusable wait-set write-lock operation.
src/​handle_manager.cpp Extracts interrupt-and-lock synchronization into a shared helper.
src/​executor.h Declares synchronized subscription filter updates.
src/​executor.cpp Applies filter changes under the wait-set write lock.
lib/​subscription.js Passes the owning node to native filter-update and clear calls.

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The native executor/DDS synchronization changes need runtime validation because the spin(-1) regression could not run in this review environment, leaving reader-replacement safety and deadlock risks unverified.

No open issues 🎉

Review effort: Balanced

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 91.356% (+0.001%) from 91.355% — minggangw:fix-content-filter-synchronization into RobotWebTools:develop

This branch has not been deployed

No deployments
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.

Synchronize content filter changes with the executor

3 participants