Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check the rcl_action return value on cleanup. #672

Merged
merged 4 commits into from Feb 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion rclpy/src/rclpy/_rclpy.c
Expand Up @@ -256,7 +256,7 @@ _rclpy_arg_list_fini(int num_args, char ** argv)
for (int i = 0; i < num_args; ++i) {
char * arg = argv[i];
if (!arg) {
// NULL in list means array was partially inititialized when an error occurred
// NULL in list means array was partially initialized when an error occurred
break;
}
allocator.deallocate(arg, allocator.state);
Expand Down
9 changes: 7 additions & 2 deletions rclpy/src/rclpy/_rclpy_action.c
Expand Up @@ -1575,11 +1575,16 @@ rclpy_action_process_cancel_request(PyObject * Py_UNUSED(self), PyObject * args)
action_server, cancel_request, &cancel_response);
destroy_cancel_request(cancel_request);
if (RCL_RET_OK != ret) {
rcutils_error_string_t original_error = rcl_get_error_string();
const char * extra_error = "";
ret = rcl_action_cancel_response_fini(&cancel_response);
if (RCL_RET_OK != ret) {
extra_error = ". Also failed to cleanup response.";
fujitatomoya marked this conversation as resolved.
Show resolved Hide resolved
}
PyErr_Format(
PyExc_RuntimeError,
"Failed to process cancel request: %s",
rcl_get_error_string().str);
"Failed to process cancel request: %s%s",
original_error.str, extra_error);
rcl_reset_error();
return NULL;
}
Expand Down