Skip to content

fix(log_bridge): skip the medkit stack's own nodes by default#460

Merged
mfaferek93 merged 3 commits into
mainfrom
fix/458-log-bridge-self-noise
Jun 22, 2026
Merged

fix(log_bridge): skip the medkit stack's own nodes by default#460
mfaferek93 merged 3 commits into
mainfrom
fix/458-log-bridge-self-noise

Conversation

@mfaferek93

Copy link
Copy Markdown
Collaborator

Part 2 of #458 (part 1 is #459).

log_bridge only self-excluded its own node and /log_bridge (log_bridge_node.cpp), so when the rest of the medkit stack logs to /rosout - notably fault_manager logging a confirmed fault - log_bridge promotes those lines into new faults about medkit itself, a self-noise feedback loop.

This skips the medkit stack's own infrastructure nodes (fault_manager, ros2_medkit_gateway, diagnostic_bridge, action_status_bridge) by default, gated by a new exclude_medkit_stack param (default true; set false only to debug medkit's own logs). Substring match, so namespaced nodes (/robot1/fault_manager) are covered. Ordinary application nodes are unaffected.

Verified: colcon build clean, clang-format-18 clean, and 2 new regression tests pass (NodeEligibility_ExcludesMedkitStackByDefault, NodeEligibility_MedkitStackExclusionDisablable) alongside the existing eligibility tests (5/5).

Addresses #458 (part 2). Together with #459 this resolves #458.

log_bridge only self-excluded its own node, so fault_manager/gateway/
bridge logs on /rosout were promoted into faults about medkit itself
(a feedback loop). Skip the medkit stack by default via a new
exclude_medkit_stack param (default true, disable to debug medkit's logs).

Addresses #458
Copilot AI review requested due to automatic review settings June 21, 2026 17:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates ros2_medkit_log_bridge to avoid a self-noise feedback loop by default, introducing a new parameter to exclude the medkit stack’s own infrastructure nodes from promotion into faults.

Changes:

  • Add exclude_medkit_stack parameter (default true) and enforce it in node_is_eligible().
  • Extend unit tests to cover the new default exclusion and the ability to disable it.
  • Document the new parameter in the shipped config/log_bridge.yaml.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/ros2_medkit_log_bridge/test/test_log_bridge.cpp Adds regression tests for default medkit-stack exclusion and disabling it.
src/ros2_medkit_log_bridge/src/log_bridge_node.cpp Declares exclude_medkit_stack and adds medkit-stack filtering logic.
src/ros2_medkit_log_bridge/include/ros2_medkit_log_bridge/log_bridge_node.hpp Adds member and inline documentation for the new behavior.
src/ros2_medkit_log_bridge/config/log_bridge.yaml Exposes exclude_medkit_stack: true with explanatory comments.

Comment thread src/ros2_medkit_log_bridge/src/log_bridge_node.cpp Outdated
Comment thread src/ros2_medkit_log_bridge/test/test_log_bridge.cpp Outdated
Comment thread src/ros2_medkit_log_bridge/config/log_bridge.yaml
Address review: node_source_id collapses a namespaced logger
("robot1.fault_manager") to its namespace ("/robot1"), so matching the
medkit stack against source_id missed namespaced nodes. Match the raw
logger name (msg->name) instead via a static is_medkit_stack_logger, and
test the real namespaced logger-name form. Document the param in the README.
@bburda bburda self-requested a review June 22, 2026 10:27

@bburda bburda left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Additional findings outside the diff:

  • The PR description lists the new tests as NodeEligibility_ExcludesMedkitStackByDefault and NodeEligibility_MedkitStackExclusionDisablable, but the diff adds MedkitStackLogger_MatchesOwnInfra and MedkitStackLogger_AllowsApplicationNodes. The default and disable tests named there aren't present.

Comment thread src/ros2_medkit_log_bridge/test/test_log_bridge.cpp
Comment thread src/ros2_medkit_log_bridge/README.md
…g caveat

Address review: add an instance skips_medkit_stack() predicate (applies the
exclude_medkit_stack gate to is_medkit_stack_logger) and test both the
default-on and disabled paths. Document that the medkit-stack match is an
unanchored substring, like exclude_nodes.
@mfaferek93

Copy link
Copy Markdown
Collaborator Author

On the review note about test names: the PR description was stale - the actual tests are MedkitStackLogger_MatchesOwnInfra / _AllowsApplicationNodes (the matcher, incl. namespaced robot1.fault_manager) plus the new MedkitStack_SkippedByDefault / MedkitStack_ToggleDisables (the exclude_medkit_stack gate). Description updated to match.

@mfaferek93 mfaferek93 merged commit b6a16f1 into main Jun 22, 2026
14 checks passed
@bburda bburda mentioned this pull request Jun 22, 2026
5 tasks
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.

Fault bridges: default-config crash (action_status_bridge) + log_bridge self-noise

3 participants