Skip to content

Fix flakey minimal publisher shutdown#36

Merged
sgillen merged 2 commits intoNVIDIA-ISAAC-ROS:mainfrom
bmchalenv:fix-flakey-minimal-publisher-shutdown
Feb 27, 2026
Merged

Fix flakey minimal publisher shutdown#36
sgillen merged 2 commits intoNVIDIA-ISAAC-ROS:mainfrom
bmchalenv:fix-flakey-minimal-publisher-shutdown

Conversation

@bmchalenv
Copy link
Contributor

No description provided.

Signed-off-by: Blake McHale <bmchale@nvidia.com>
@greptile-apps
Copy link

greptile-apps bot commented Feb 27, 2026

Greptile Summary

This PR applies defensive exception handling to two publisher main entry points to prevent flaky test failures during shutdown. The changes catch rclcpp::exceptions::RCLError exceptions that occur when the ROS context becomes invalid during rclcpp::spin(), which is an expected race condition during test teardown. This pattern was previously applied to greenwave_monitor_main.cpp (in PR #22) and is now being consistently applied across all main entry points.

Key changes:

  • Added try-catch blocks around rclcpp::spin() calls in both files
  • Catches RCLError and logs at DEBUG level with explanatory message
  • Updated copyright year to 2025-2026 in minimal_publisher_main.cpp
  • Implementation matches the existing pattern in greenwave_monitor_main.cpp

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • The changes are minimal, well-tested pattern already in use, defensive in nature (only adds safety), and directly addresses a known flakiness issue. The implementation is consistent with existing code and follows ROS 2 best practices for handling shutdown exceptions.
  • No files require special attention

Important Files Changed

Filename Overview
greenwave_monitor/src/minimal_publisher_main.cpp Added try-catch for RCLError during shutdown to prevent flaky test failures, updated copyright year to 2026
greenwave_monitor/src/example_greenwave_publisher_main.cpp Added try-catch for RCLError during shutdown to prevent flaky test failures

Last reviewed commit: 54d9ca1

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Signed-off-by: Blake McHale <bmchale@nvidia.com>
@sgillen sgillen merged commit 0bb90db into NVIDIA-ISAAC-ROS:main Feb 27, 2026
17 checks passed
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.

2 participants