ros2 / ros2/rclcpp

cannot call shutdown from within action server's handle goal callback

Open
#600 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C++
Stars
805
Forks
564
Avg merge
1d 17h
Merged PRs (30d)
27

Description

Currently, if you do something like this in the handle goal callback for an Action server:

RCLCPP_ERROR(logger, "there was a problem");
rclcpp::shutdown();
return rclcpp_action::GoalResponse::REJECT;

Then you'll get an error during shutdown like this:

libc++abi.dylib: terminating with uncaught exception of type rclcpp::exceptions::RCLError: feedback publisher is invalid, at /Users/william/ros2_ws/src/ros2/rcl/rcl_action/src/rcl_action/action_server.c:913

This is because the action server tries to send a rejection response after shutdown is called (and therefore after the context is invalid).

This is actually a symptom of a larger issue which is that some communication activity needs to continue to work after shutdown. So if we address that issue, then this one may be resolved directly.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the shutdown call from an action server handle goal callback, then inspect the rejection-response path in rcl_action/action_server.c around the reported failure. Done means shutdown from the callback no longer causes an uncaught RCLError and the action server's post-shutdown communication behavior is defined.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
api, backend
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.