Skip to content

Handle exceptions in lifecycle transition callbacks#1696

Open
saikishor wants to merge 2 commits into
ros2:rollingfrom
saikishor:handle/exceptions/transition_cb
Open

Handle exceptions in lifecycle transition callbacks#1696
saikishor wants to merge 2 commits into
ros2:rollingfrom
saikishor:handle/exceptions/transition_cb

Conversation

@saikishor

Copy link
Copy Markdown

Description

In rclcpp_lifecycle the exceptions are properly handled here during transistion callbacks: https://github.com/ros2/rclcpp/blob/527275027cee68bf817a5d0824f15803114a4d2d/rclcpp_lifecycle/src/lifecycle_node_interface_impl.cpp#L514-L527

However, in rclpy currently, it simply crashes the node. I think it is better to be consistent between both the libraries, for this reason this PR is opened

Is this user-facing behavior change?

Yes, previously it crashes, but now the node ends up unconfigured

Did you use Generative AI?

Claude, to refine the added tests

Signed-off-by: Sai Kishor Kothakota <sai.kishor@pal-robotics.com>
Signed-off-by: Sai Kishor Kothakota <sai.kishor@pal-robotics.com>
@mergify

mergify Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@saikishor
saikishor force-pushed the handle/exceptions/transition_cb branch from 1181676 to 8f0639c Compare July 17, 2026 08:19
@ahcorde

ahcorde commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Pulls: #1696
Gist: https://gist.githubusercontent.com/ahcorde/a3e908ee988a3d5d9743f5cf96ae0492/raw/8ddf329f1bd988acb5db99b7fe225c71074bcc1f/ros2.repos
BUILD args: --packages-above-and-dependencies rclpy
TEST args: --packages-above rclpy
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/19894

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@saikishor

Copy link
Copy Markdown
Author

@ahcorde Is it also possible to backport this change?

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